Skip to main content Accessibility Feedback

Arrays

Array.reverse()

Reverse the order of items in an array.

var count = [1, 2, 3, 4, 5];

// Reverse the array order
count.reverse();

// logs [5, 4, 3, 2, 1]
console.log(count);

Works back to at least IE6.