Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Using the Unshift() Method to Reverse an Array

var arr = [1, 2, 3, 4];
var arr1 = [];
arr.forEach(element => {
    arr1.unshift(element)
});
console.log(arr1);
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Using #Method #Reverse #Array
ADD COMMENT
Topic
Name
3+7 =