reverse array with javascript code example
Example 1: reversing an array in js
var arr=[1,2,5,6,2]
arr.reverse()
Example 2: js array reverse
const arr = [34, 234, 567, 4];
console.log(arr);
const new_arr = arr.reverse();
console.log(new_arr);
var arr=[1,2,5,6,2]
arr.reverse()
const arr = [34, 234, 567, 4];
console.log(arr);
const new_arr = arr.reverse();
console.log(new_arr);