Skip to content
Justice Tech School

JavaScript Comments

Use // for a single line comment and /* ... */ for several lines. Comments are ignored when the code runs. Use them to explain why you did something, not to repeat what the code obviously does.

Example
// A single line comment
let price = 20; // inline comment

/* A comment
   over several lines */
console.log(price);

Exercise

Start a single line comment.

 this line is ignored

Quiz Test

Which starts a single line comment?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.