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
Below is a solution with best space and time complexity
function reverse(arr){ let i = 0; let j = arr.length-1; while(i
output => [9,8,7,6,5,4,3,2,1]