Lets take a look at an example of a single-line comment.
// This is an example of single line comment document.write("Hello World");
A block comment is sometimes called a multi-line comment. Anything between /* and */ will be ignored.
It starts with /* and ends with */
/* This is an example of Multi line comment Below code will print "Hello World" */ document.write("Hello World");
Code should not be repeated in comments.
Comments must solve confusion rather than create it.
When fixing bugs, include comments.
Create meaningful comments for methods and functions.