The usage of the reverse function in js


The reverse() method is used to reverse the order of the elements in an array

Note: this method changes the original array instead of creating a new one.

**Example: **Var  STR = [’ 1 ’, ‘2’, ‘3’);

Document. The write (a);

Output: 3, 2, 1