JavaScript Array concat() Method

The JavaScript array concat() method is used to return a new array object that contains two or more merged arrays.

Syntax:

array.concat (array1,array2,....)

Example:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
var a1=["GOLD","SILVER","DIAMOND"];
var a2=["RUBY","PLATINUM"];
var a3=["BRONZE"];
var sum=a1.concat(a2,a3);
document.writeln(sum);
</script>
</body>
</html>
Please follow and like us:
Content Protection by DMCA.com