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..



You May Interest

What is Difference Between Javascript and ECMAScript ?

JavaScript Getting Absolute Value

What are Advantages of Using External Javascript ?

What are Advantages of Javascript ?

What are Asynchronous Scripts in Javascript ?