JavaScript Code


JavaScript Comments


Comments

Comments are descriptive part of the code that are used only for program readability, but ignored by the interpreter.

Based on the number of lines a comment can be written, we have single line comments, and multiline comments.

Single Line Comments

Single line comments start with double forward slash //.

//this is a single line comment

Multiline Comments

Multiline comments start with /* and end with */ spanning one or more lines.

/*
this comment
has multiple
lines
*/