js reverse array to new const 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