Reverse Accumulator
MediumAcc. 90.2%
+25 XP 10
Backward Thinking
Sometimes we need to process data in the opposite order it was received.
The Assignment
Your function receives an array data.
- Use a loop to iterate from the last index down to 0.
- Print each element on a new line.
01EXAMPLE 1
Input
data = [1, 2, 3]Output
3
2
1Explanation: Output in reverse order.
Constraints
- Start the loop at array.length - 1.
- Stop when the index is 0.
ArraysLoops
JavaScriptSystem handles I/O — write your function only
Loading...
2 Hidden
Input Arguments
data[1,2,3]
Expected Output
3 2 1
Click RUN to test your solution