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]
Array.reverse on MDN