how to join two arrays using javascript

how to merge two arrays using javascript

Solution

<html>
<body>

<script type=”text/javascript”>

var Parents = ["Dad", "Mom"];
var Children = ["Child1", "Child2"];
var Family = Parents.concat(Children);
document.write(Family);

</script>

</body>
</html>

 

About the Author

avatar