Prefix Increment
EasyAcc. 94.8%
+20 XP 5
Priority Updates
The Prefix Increment (++count) adds 1 to the variable and returns the newly updated value immediately.
- Assign
++pointsto a variable namedbonusPoints. - Return both values in an array:
[bonusPoints, points].
01EXAMPLE 1
Input
points = 10Output
[11, 11]Explanation: Updates then returns the result.
Constraints
- Use prefix ++.
- Both values in result must be equal.
FundamentalsMathOperators
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
points10
Expected Output
[11,11]
Click RUN to test your solution