reverse() method reverses the order of the elements in an array.
reverse() method does not accept any parameter.
reverse() method overwrites the original array.
reverse() method returns a reference to the original array, so mutating the returned array will mutate the original array as well.
To reverse the elements in an array without mutating the original array, use toReversed() method.
reverse() method preserves empty slots.
const myArray = [1, 2, , 4, 5, , 7, 8];
myArray.reverse(); returns ↴
[8, 7, empty, 5, 4, empty, 2, 1]
myArray.reverse()