JavaScript Concatenating Arrays
The concat() method is used to concatenate 2 or more strings in JavaScript.
The usage is as follows...
var fruit = ['apple', 'orange', 'kiwi']; var num = [1, 2, 3]; var conc = fruit.concat(num); for (let itm of conc) { document.write(itm); document.write(""); }
The result will be like this..