reverse array without using reverse method javascript code example
Example 1: how to reverse an array in javascript
array = [1 2, 3]
reversed = array.reverse()
Example 2: reverse an array javascript
const reversed = array1.reverseconst reversed = array1.reverse();
console.log('reversed:', reversed);
// expected output: "reversed:" Array ["three", "two", "one"]();
console.log('reversed:', reversed);
// expected output: "reversed:" Array ["three", "two", "one"]const reversed = array1.reverse();
console.log('reversed:', reversed);
// expected output: "reversed:" Array ["three", "two", "one"]
Example 3: array reverse in javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.reverse();