标签:
使用 concat() 方法来合并两个数组。
编辑您的代码:
<html>
<body>
<script type="text/javascript">
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"
var arr2 = new Array(3)
arr2[0] = "James"
arr2[1] = "Adrew"
arr2[2] = "Martin"
document.write(arr.concat(arr2))
</script>
</body>
</html>
查看结果:
George,John,Thomas,James,Adrew,Martin
标签:
原文地址:http://www.cnblogs.com/zifashaonian10000/p/4221905.html