1var arr = [34, 234, 567, 4];
2print(arr);
3var new_arr = arr.reverse();
4print(new_arr);
5
1const array1 = [1,2,3,4];
2console.log('array1:', array1);
3//"array1:" Array [1, 2, 3, 4]
4
5const reversed = array1.reverse();
6console.log('reversed:', reversed);
7//"reversed:" Array [4, 3, 2, 1]
8
9// Careful: reverse is destructive -- it changes the original array.
10console.log('array1:', array1);
11//"array1:" Array [4, 3, 2, 1]
1const arr = [34, 234, 567, 4];
2console.log(arr);
3const new_arr = arr.reverse();
4console.log(new_arr);