How to reverse elements of array in JavaScript

Arrays
Last updated Dec 19, 2017
const data = [1, 2, 3, 4, 5];

const reversed = data.reverse();
[5, 4, 3, 2, 1]