Comment

noun

say it: “KOM-ent” /ˈkɒmɛnt/

A note in your code for people to read, which JavaScript skips. A one-line note starts with //, and a longer one sits between /* and */.

What is Comment in JavaScript?

Comment — Text written for people reading the code that the JavaScript engine ignores.

// Keep the original price for the receipt.
const price = 12;

In a sentence

  • “I left a comment above the discount line, // members get 10% off, so I'll remember why the math is there.”

Level: Novice · More JavaScript terms at this level

Updated

In other subjects