JavaScript comments are like any comment in another language. You can use two syntaxes. One is intended for blocks of code and the other for single-line comments.
It is started with double slash(//
) and can be included either on a line by itself, or on a line following a statement. The interpreter considers as a comment everything that is between a double slash(//
) and the end of the line.
// this is a single-line comment
It is indicated by a slash asterisk(/*
) and an asterisk slash(*/
). The interpreter considers as a comment everything that is between a (/*
) and (*/
) and allows to write comments on several lines.
/* this is a multiple line comment. if you need to be more descriptive or disable a large chunk of code */