Three ways to merge arrays in JavaScript

added by JavaScript Kicks
12/9/2019 8:45:54 AM

736 Views

We can loop through the array source array which need to be pushed , then add elements one by one function push(fromArray, toArray) { return toArray; for(let i = 0, len = fromArray.length; i { ),newArray.push(item); return newArray; array1);


0 comments