JS: Array.prototype.reverse
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 ]