×

javascript · level 1 · unit 2 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

Put something new in a box and the old thing is gone.

A box holds one value at a time. Store a new value and you the old one, like wiping a whiteboard. Leave out let this time: the box already exists, so you only change what is inside.

The + sign can two strings into one: "pop" + "corn" makes "popcorn". It adds no space, so put one inside the quotes if you need it.

Some values should never change, like your birthday. Make those boxes with instead of let. Try to overwrite one and JavaScript stops with a .

let mood = "sleepy";
mood = "happy";
console.log("I feel " + mood);
const birthday = "12 May";
console.log("My birthday is " + birthday);

Use let for boxes that will change and const for boxes that never will.