JavaScript: Array.prototype.reverse

By Xah Lee. Date: . Last updated: .
arrayX.reverse()
Reverse the order of elements of array. Return the modified array. The original is changed.
const hh = [3,4,5];

console.log( hh.reverse () ); // [ 5, 4, 3 ]

// original is changed
console.log( hh ); // [ 5, 4, 3 ]
BUY ΣJS JavaScript in Depth