Comments and Statements
Notes and semicolons.
A program is a list of instructions, called statements, that run from top to bottom. And sometimes you want to leave a note for humans, that the computer ignores. That's a comment.

- Statements run top to bottom
- Notes for humans
- Comments
Comments
Two slashes start a comment that runs to the end of the line. Slash star starts a comment that can cover many lines, until star slash. JavaScript skips them completely. Each statement usually ends with a semicolon. Run it. Only the real statements print.
// This is a comment. JavaScript ignores it.
console.log("Line one");
/* This comment
covers several lines */
console.log("Line two"); // a comment can end a line tooLine one Line two
Semicolons
Semicolons mark the end of a statement, like a full stop in a sentence. JavaScript can usually add missing ones for you, but not always correctly, so most style guides recommend writing them yourself. In this course, every statement ends with a semicolon.
| key | value |
|---|---|
| // | one-line comment |
| /* */ | multi-line comment |
| ; | ends a statement |
| Order | top to bottom |
Summary
Statements run top to bottom, end with semicolons, and comments are notes the computer ignores. Next, storing values in variables.
Key takeaways- // and /* */
- End with ;
- Top to bottom