Variables in ECMAScript are declared using the var keyword. Variable names must begin with a letter or an underscore followed by zero or more letters, numbers, and underscores. ECMAScript variables are case-sensitive.
ECMAScript supports weak typing. The programmer does not need to specify the type of a variable when declaring it; the interpreter automatically associates one of the five built-in ECMAScript types with the new variable based on the nature of the value assigned to it. These built-in types are shown in Table A-2.
|number||either a floating-point or integer||
var e = 2.71828; var i = -1;
|Boolean||only true or false||
var b = true;
|string||a string of characters||