js array reverse index code example Example: reversing an array in js var arr=[1,2,5,6,2] arr.reverse()