settingsAccountsettings
Menusettings

Q: Print numbers in reversed order

+8 votes

You will be given random numbers as input. You need to print them backwards, compared to the order they were received, each on a new line.

Examples:

Input

Output

 

Input

Output

 

Input

Output

10

15

20

20

15

10

 

5

5.5

24

-3

-3

24

5.5

5

20

1

20

1

20

20

1

20

1

20

 

asked in JavaScript category by user paulcabalit

1 Answer

+2 votes
 
Best answer

Here is the solution to this task:

function reversedOrder(arr) {
  arr.reverse();
  for (let num of arr) {
    console.log(num)
  }
}

 

answered by user richard8502
selected by user golearnweb
...