91-9990449935 0120-4256464 |
JavaScript CommentThe JavaScript comments are meaningful way to deliver message. It is used to add information about the code, warnings or suggestions so that end user can easily interpret the code.
The JavaScript comment is ignored by the JavaScript engine i.e. embedded in the browser. Advantages of JavaScript commentsThere are mainly two advantages of JavaScript comments.
Types of JavaScript CommentsThere are two types of comments in JavaScript.
JavaScript Single line CommentIt is represented by double forward slashes (//). It can be used before and after the statement. Let’s see the example of single-line comment i.e. added before the statement. Test it NowLet’s see the example of single-line comment i.e. added after the statement. Test it NowJavaScript Multi line CommentIt can be used to add single as well as multi line comments. So, it is more convenient. It is represented by forward slash with asterisk then asterisk with forward slash. For example: It can be used before, after and middle of the statement. Test it Now
Next TopicJavaScript Variable
|