×

javascript · level 1 · unit 2 · lesson 3

  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

Give every box a name that tells you what is inside.

Names can use letters, digits, _ and $. They cannot contain spaces or start with a digit. A like let or const is taken, because JavaScript keeps those words for itself.

A good name says what is inside. x could be anything, but petName explains itself. Case matters too, so petName and petname are two different boxes.

If a name needs several words, squash them together and start each new word with a capital, like bestFriend. This style is called , because the capitals stick up like a camel's humps.

let bestFriend = "Priya";
console.log("My best friend is " + bestFriend);

A camelCase name starts with a small letter, so it is bestFriend, not BestFriend.