• Register
100 points
5

In Javascript, there is one array method which combines two array and return new array with combined array which is concat() method.

Concat() method is used for joining two or more arrays.

Note that this Javascript method does not affect the existing array but actually return new array which consists the combination of arrays.

Example

var name = ["ram", "sham"];
var first = ["singh", "chand", "gupta"];
var last = ["KodLogs"];
var children = name.concat(first, last);
console.log(children);

Output

ram, sham,singh, chand, gupta, KodLogs

 

 
100 points
5