reverse method is used to reverse the order of the array such that the first element becomes the last and the last element becomes the first
//Name of the file : array-reverse.js
arr = ['b','e','a','o','p','n','r'];
console.log(arr);
arr.reverse();
console.log(arr);
>node array-reverse.js
[ 'b', 'e', 'a', 'o', 'p', 'n', 'r' ]
[ 'r', 'n', 'p', 'o', 'a', 'e', 'b' ]