Basics: Comments

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


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:

// a comment
true //another comment

Another type of comment is a multi-line comment. It starts with /* and ends with */.

Everything in between is not considered as code:

/* some kind
of
comment

*/

Lessons in this unit:

0: Introduction
1: Literals, identifiers and variables
2: ▶︎ Comments
3: The difference between let, const and var
4: Types
5: Operators and expressions
6: Let's start with arithmetic operators
7: The assignment operator
8: Operators precedence
9: Strings
10: Numbers
11: Semicolons, white space and sensitivity