javascript return an array without mutating the original 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