Get Programming with JavaScript - Listing 2.01

Listing 2.01 - Declaring a variable

var score;

Further Adventures

To declare a variable, use the var keyword.

Listing 2.01 - Declaring a variable - Task 3

var name; var total;

The name you give to the variable must not be one of JavaScript's reserved words and it must follow the rules for valid identifiers.