JavaScript Comments

Comments are used to explain code and provide useful information about what the code does and comments are ignored by the browser. It is a good practice to write comments in the code so that the purpose of the code is clear and can be understood.

Single-line comment

Multi-line comment