As programs get bigger and more complicated, they get more difficult to read.
Good programmers try to make their code understandable to others, but it is
still tricky to look at a large program and figure out what it is doing and
Best practice encourages us to add notes to our programs, which clearly
explain what the program is doing. These notes are called comments.
A comment is text within a program intended only for a human reader---it is
token starts a comment, and the rest of the line gets ignored. For comments
that stretch over multiple lines, the text falls between the symbols
Experiment by adding and removing comments to the code.
// This demo shows off comments!
// console.log("This does not print.");
console.log("Hello, World!"); // Comments do not have to start at the beginning of a line.
/* Here is how
console.log("Comments make your code more readable by others.");
Notice that when you run the program, it still prints the phrase Hello,
World, but none of the comments appear. Also notice the blank lines left in
the code, which are also ignored by the compiler. Comments and blank lines make
your programs much easier for humans to understand. Use them frequently!