var x = 7;
var y = 12;
var sum = x + y;
document.write(sum); // Show variable value
var one = 1; two = 2; three = 3; //three different statements var four = 4; //single statement
var five = "Five" //single statement without ;
For example, The variable myVar must be typed myVar not MyVar or myvar, Name is not equal to name etc.
var myVar = "Tutorials Trend!";
If you look at the browser console by clicking the F12 key on your keyboard, you'll notice something like "Uncaught ReferenceError: MyVar is not defined."
Here's an example:
Whereas, a multi-line comment begins with a slash and an asterisk (/*) and ends with an asterisk and slash (*/). Here's an example of a multi-line comment.