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