Reverse the order of items in an array 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); Source https://vanillajstoolkit.com/reference/arrays/array-reverse/