reverse array without mutating javascript code example Example: array reverse without mutating var newarray = array.slice().reverse();