When Programming, it is good to write the comments around the code so that you know what it is doing and so people reading your code knows what it is doing.
This example uses single line comments to explain the code:
//single line Comment
document.write("HELLO"); //this will write HELLO
If you want to add Multi line comments in your JvaSript code then start with /* and end with */.
Example on Multi line comment :
The code below will write
one header and two paragraphs
document.write("<h1>This is a header</h1>");
document.write("<p>This is a paragraph</p>");
document.write("<p>This is another paragraph</p>");