December 2013
Intermediate to advanced
384 pages
9h 54m
English
var x = y = 5; var z = 10; var results = "x + y + z = " + (x+y+z); var s1 = "jQuery"; var s2 = "JavaScript" var s3 = s1 + " & " + s2;
JavaScript makes it easy to define variables. Variables are assigned using var name = value; syntax. The var keyword tells JavaScript that this is a new variable name. Once the variable has been assigned a value, you can access it using the variable name. You can define multiple variables on a single line using var name1 = name2 = value; syntax.
When you assign a variable to an expression, such as x + y + z, the expression is evaluated before assigning the variable a value. The following code snippet shows you how to define and access ...
Read now
Unlock full access