create a new array reverse javascript permanently code example Example: reversing an array in js var arr=[1,2,5,6,2] arr.reverse()