reverse()
method reverses the order of items in an array.
reverse() |
Yes | Yes | Yes | Yes | Yes |
array.reverse()
None
reverse()
function returns an array in reversed order.
var values = [1, 2, 3, 4, 5];
values.reverse();
console.log(values); //5,4,3,2,1
reverse()
returns a reference to the resulting array.
The code above generates the following result.