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 ++:
- Returns the value (this returns
0) - Increments the value (number is now
1)
The prefix unary operator ++:
- Increments the value (number is now
2) - Returns the value (this returns
2)
This returns 0 2 2.
Question 16 · see the original (opens in a new tab)
or press Enter