jeandremelaria
10/18/2017 - 2:08 PM

Js - Concatenate arrays

Concat can be used to merge the contents of two arrays into one.

var array1 = [1,2,3,4,5];
var array2 = [6,7,8,9,10];

var newArray = array1.concat(array2);

console.log(newArray); // returns 1,2,3,4,5,6,7,8,9,10