Comments are an important part of the program it allows to add notes and explanations with the code. It has no impact on the execution of JavaScript code because they are ignored when the code is run.
In JavaScript, there are two types of comments –
- Single line, and
- Multiple lines