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 are Control Flow Statements in Javascript ?

What is Difference Between Javascript and ECMAScript ?

What is setInterval Function in Javascript ?

What are Deferred Scripts in Javascript ?

What are Important Events in Javascript ?