JS: Array.prototype.reverse
xArray.reverse()
-
- Reverse the order of elements of array.
- Return the modified array.
- The original is changed.
const xx = [3, 4, 5]; console.log(xx.reverse()); // [ 5, 4, 3 ] // original is changed console.log(xx); // [ 5, 4, 3 ]