Notes
Single line comments start with //
.
Any text between // and the end of the line will be ignored by JavaScript.
var x; //A variable with the name x is defined
x=15 //The variable x is assigned to 15
document.write(x);
Output: 15
Multi-line comments start with /*
and end with */
.
var x;
x=15
/*A variable with the name x is defined
and then assigned to 15 */
document.write(x);
Output: 15