JavaScript Comments
Comments are used to notes to others and ourselves describing our thinking. often used to outline the program with pseudo code. It is also used to documentation and does not run by browser. Any text between comments and the end of the line will be ignored by JavaScript. It will not be executed.
There are two types of comments is as follows
1.Single line Comment:
Single line comment denoted by // (two forward slashes). A new line not immediately preceded by a backslash terminates this form of comment. Therefore, it is commonly called a "single-line comment" as shown below.
Uses two forward slashes (i.e. //) Single Line Comment Example
Example
Output
2.Multi Line Comment:
Multi line comment denoted in between by /*(forward slash and asterisk) marks the beginning of the comment, and the */( asterisk and forward slash) marks the end. You can have your comment span multiple lines and anything between those /*…*/ is considered a comment for example as shown below.
Example
Output