Section 1 - Instruction

Remember that storing information in variables is like putting data into labeled boxes?

For example: let score = 100;

Engagement Message

Can you tell me what value is stored in score?

Section 2 - Instruction

Now, let's talk about the names we give our variables. Just like you can't label a real box with anything (maybe not symbols or blank spaces), there are rules for naming variables in JavaScript.

Variable names can contain letters (a-z, A-Z), numbers (0-9), the underscore character (_), or the dollar sign ($).

Engagement Message

Make sense so far?

Section 3 - Instruction

However, there's a catch with numbers: a variable name cannot start with a number.

So, player1 is a valid name, but 1stPlayer is not.

Engagement Message

Do you think we can make a variable named 0Day?

Section 4 - Instruction

Another important rule: variable names cannot contain spaces. If you want to represent a multi-word concept, use camelCase like highScore (which is common in JavaScript).

For example, highScore is good, but is not.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal