Skip to main content Accessibility Feedback

Numbers

Increment & Decrement

You can increment numbers up one in value with the ++ operator, and decrement them down one in value using the -- operator.

let num = 1;

// Increment
// logs 2
num++;
console.log(num);

// Decrement
// logs 1
num--;
console.log(num);