Increment Operator

noun

say it: “IN-kruh-ment OP-er-ay-ter” /ˈɪŋkrəmənt ˈɒpəreɪtər/

The ++ symbol, read "plus plus": it adds 1 to a number variable, so coins++ means coins = coins + 1.

What is Increment Operator in JavaScript?

Increment Operator — The ++ symbol, read "plus plus". It adds 1 to a number variable, so coins++ does the same as coins = coins + 1. Its partner, --, takes 1 away. You'll see it most in the step of a for loop.

let coins = 9;
coins++;
console.log(coins); // 10

In a sentence

  • “Every coin the player grabs runs coins++, the increment operator adding one more.”

Level: Novice · More JavaScript terms at this level

Updated

In other subjects