After Updating

EasyAcc. 92.4%
+20 XP 5

Counting Queues

When increasing variables smoothly, the Postfix Increment (++) symbol increments numbers safely. But notably, it returns the number as it existed right before going up.

The Assignment

Let's see postfix happen precisely.

  1. Assign count++ directly to a newly scoped variable newCount.
  2. Make an array putting both back in: [newCount, count] and return securely.

01EXAMPLE 1

Inputcount = 5
Output[5, 6]

Explanation: Returns current 5 immediately, then shifts count to 6.

Constraints

  • Use postfix ++.
  • Original variable is expected updated inside logic.
FundamentalsMathOperators
JavaScript
Loading...
5 Hidden

Input Arguments

count5

Expected Output

[5,6]

Click RUN to test your solution