Advertisement
Google Ad Slot: content-top
JS Comments
In JavaScript, comments are used to write notes, explanations, or temporarily disable parts of code. Comments are ignored by the JavaScript engine during execution, making them useful for improving code readability and documentation.
There are two types of comments in JavaScript:
1. Single-Line Comments
Single-line comments start with //. Everything after // on that line will be treated as a comment
2. Multi line comments
Multi-line comments start with /* and end with */. They can span multiple lines and are useful for longer explanations or to comment out blocks of code.