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
We have reverse() function to reverse the given array in JS.
var a = [7,8,9];
a.reverse(); // 9 8 7
function reverseArr(input)
{
var ret = new Array;
for(var i = input.length-1; i >= 0; i--)
{
ret.push(input[i]);
}
return ret;
}