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.

  1. Assign count++ to a variable named newCount.
  2. Return both values in an array: [newCount, count].

01EXAMPLE 1

Inputcount = 5
Output[5, 6]

Explanation: Returns current value, then increments.

Constraints

  • Use postfix ++.
  • Original variable must be updated.
FundamentalsMathOperators
JavaScript
Loading...
9 Hidden

Input Arguments

count5

Expected Output

[5,6]

Click RUN to test your solution