Postfix Increment
EasyAcc. 92.4%
+20 XP 5
Sequenced Updates
The Postfix Increment (++) operator adds 1 to a variable, but returns the value as it was before the increment.
- Assign
count++to a variable namednewCount. - Return both values in an array:
[newCount, count].
01EXAMPLE 1
Input
count = 5Output
[5, 6]Explanation: Returns current value, then increments.
Constraints
- Use postfix ++.
- Original variable must be updated.
FundamentalsMathOperators
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
count5
Expected Output
[5,6]
Click RUN to test your solution