Very few programming languages do not support comments. Comments are useful ways of adding contextual information about a piece of code in a program.
JavaScript comments
JavaScript features comments too. In JavaScript a comment is signified by either of the following two symbols:
//
/* */
The difference between these two types of comments is that the first version only works across a single line:
JavaScript
//This is a comment
The second version can span multiple lines:
JavaScript
/* This is a comment * This is also a comment */
It is often the case to use an asterisk on each line between the opening and closing comment tags as shown on line 2 previously but it is not completely necessary.
Did you know my courses are all printer-friendly? This means you can easily export them to PDF or print them for later use.