array reverse based on index javascript : How to Reverse an javascript array based on passing of index value.
similar like array.reverse(5);

input: array=[0,1,2,3,4,5,6];
for 5:
output:array[4,3,2,1,6,5];


          

