Beginner · Lesson 2 of 12

Variables & values

A variable gives a name to a value. Choose names that describe the information, such as score or learner_name. Assign a value before you read it, and remember that assigning again replaces the previous value.

Try it for yourself

Run the example, then change one thing and see what happens.

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-82 lines

Expected output

Hello Developer

Make it your own

Create a variable for your favorite city and display it.

A quick check

Which habit helps when learning variables & values?

PreviousNext lesson