var x = 5; var y = 6; var z = x + y;
The most important rules for writing fixed values are:
2 + 3 10 * 4
variables are used to store data values.
An equal sign is used to assign values to variables.
var x; x = 6;
var x = 5; var y = 6;
(5 + 6) * 10
The var keyword tells the browser to create a new variable:
var x = 5 + 6; var y = x * 10;
Code after double slashes // or between /* and */ is treated as a comment.
Comments are ignored, and will not be executed:
var x = 5; // I will be executed // var x = 6; I will NOT be executed
The variables lastName and lastname, are two different variables.
lastName = "Yadav"; lastname = "Singh";
avaScript uses the Unicode character set.
Unicode covers (almost) all the characters, punctuations, and symbols in the world.