Comments
Comments are statements that will not be executed by the interpreter, comments are used to mark annotations for other programmers or small descriptions of what code does, thus making it easier for others to understand what your code does.
In JavaScript, comments can be written in 2 different ways:
Line starting with
//
:
Section of code starting with
/*
and ending with*/
, this method is used for multi-line comments:
Last updated
Was this helpful?