Page Stats
Visitor: 556
JavaScript Comment
JavaScript comment are the statements which are not executed and are ignored by the browser. Any statements written as comment will not be visible to user, it indicates the purpose of code so that code can be easily understand even if we check it later on.
There are 2 types of comments in javascript:
- // - Single-line Comment.
- /* */ - Multi-line Comment.
Single-line comment: starts with //. Any text that starts with // (double slash) and ends in a line, will be concidered as single line comment.
Multi-line comment: start with /* and ends with */. It can go on multiple lines.
Any number of comments can be placed anywhere in the program.