A comment is a piece of code that is not interpreted. There are multi-line comments and single-line comments.
Multiline comment starts with /* and ends with */
JavaScript code
/*
a comment
for a few
lines
*/
JavaScript code
A single line comment starts with // and goes to the end of the line
JavaScript code //comment for one line
Comments in the code are needed for developers who may want to fix or complete something in the code. It is important to leave comments along the code so that users and other developers can easily understand the code.