1. Definition and usage
The reverse () method is used to reverse the order of the elements in the array: reverse order.
grammar:
array.reverse()
Examples:
var arr = [1,2,3,4,5]; console.log(arr.reverse());
Output:
The reverse () method is used to reverse the order of the elements in the array: reverse order.
grammar:
array.reverse()
Examples:
var arr = [1,2,3,4,5]; console.log(arr.reverse());
Output: