How to Concatenate Arrays in Javascript
Posted on: February 17, 2021 by Ariessa Norramli
In this article, you will learn how to concatenate arrays in Javascript.
Let’s say you have two arrays and you want to combine them into a single array.
var arr1 = ["I", "love"];
var arr2 = ["code-source.tempurl.host", "very", "much"];
In order to concatenate arrays, you can use the concat()
method.
var arr1 = ["I", "love"];
var arr2 = ["code-source.tempurl.host", "very", "much"];
console.log(arr1.concat(arr2));
Note: The concat()
method functions by joining two or more arrays together.
Share on social media
//