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
reverse array and sub-array (in place) with ES6.
function reverse(array, i=0, j=array.length-1){ while (i < j){ [array[i], array[j]] = [array[j], array[i]]; ++i; --j; } }