Comments
Comments are one of the most important parts of any program. In any programming language. They are important because they let us annotate the code and add important information that otherwise would not be available to other people (or ourselves) reading the code.
In JavaScript, we can write a comment on a single line using //
. Everything after //
is not considered code by the JavaScript interpreter.
Like this:
Another type of comment is a multi-line comment. It starts with /*
and ends with */
.
Everything in between is not considered as code:
Last updated
Was this helpful?