
319 views
JavaScript Comment
The JavaScript comments are used to add explanatory notes to the code. These comments do not affect the code’s functionality and are ignored by the interpreter.
There are two types of comments in JavaScript:
1. Single-line comments: These comments start with // and continue until the end of the line. For example:
JavaScript
// This is a single-line comment
2. Multi-line comments: These comments start with /* and end with */. They can span across multiple lines. For example:
JavaScript
/*
This is a multi-line comment.
It can span across multiple lines.
*/