Can you still?

What's the output?

let number = 0;
console.log(number++);
console.log(++number);
console.log(number);

You missed this one before

The postfix unary operator ++:

  1. Returns the value (this returns 0)
  2. Increments the value (number is now 1)

The prefix unary operator ++:

  1. Increments the value (number is now 2)
  2. Returns the value (this returns 2)

This returns 0 2 2.

Question 16 · see the original (opens in a new tab)