Variables
It can often be useful to to assign a value to a variable.
Like in a math formula: x = a + 5
Var keyword
In JavaScript we can store a value in a variable with the var
keyword.
You can reassign the value later.
You can see the result below the code.
Now you try it. Make some changes to the code.
results in the same as
Try changing the code above.
Nice job! On to the next lesson.