js .reverse without mutating original array code example
Example: javascript reverse array without modifying
var newarray = array.slice().reverse(); //returns a reversed array without modifying the original
var newarray = array.slice().reverse(); //returns a reversed array without modifying the original