Code to go logo
Created using Figma
Use Cases
Contribute
How to reverse elements of array in JavaScript
Arrays
By Jad Joubran ·
Last updated Dec 19, 2017
const data = [1, 2, 3, 4, 5]; const reversed = data.reverse();
[5, 4, 3, 2, 1]
Dec 19, 2017
1
Jad Joubran
See answer
1
Jad Joubran
Array.reverse
on MDN
Learn JavaScript step by step