Javascript examples for Array:concat
The concat() joins two or more arrays.
Parameter | Description |
---|---|
array2, array3, ..., arrayX | Required. The arrays to be joined |
An Array object, representing the joined array
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w . ja v a 2s.co m var hege = ["a","b","c","d","e"]; var stale = ["a","b","c","d","e"]; var kai = ["Z"]; var children = hege.concat(stale,kai); document.getElementById("demo").innerHTML = children; } </script> </body> </html>