July 1998
Intermediate to advanced
1456 pages
65h 5m
English
var — NN 2 IE J1 ECMA 1
A keyword that defines the creation of a new variable. Although the
keyword is optional for global variables (those not declared or
initialized inside a function), it is good form to use this keyword
for each new variable. Using the var keyword
inside a function makes the variable local to statements inside the
function.
You may simply declare one or more variable names, in which case
their initial values are null. Or you can also
initialize a new variable with a value.
var a, b, c
var myName = "Susan"
Read now
Unlock full access