I am saving some data in order using arrays, and I want to add a function that the user can reverse the list. I can\'t think of any possible method, so if anybo
array
Pure functions to reverse an array using functional programming:
var a = [3,5,7,8]; // ES2015 function immutableReverse(arr) { return [ ...a ].reverse(); } // ES5 function immutableReverse(arr) { return a.concat().reverse() }