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 setInterval Function in Javascript ?

What are the Variable Naming Conventions in JavaScript ?

JavaScript Making Uppercase

What is Difference Between Undefined and Null in Javascript ?

JavaScript Taking the Square Root of a Number