「JavaScript」concat()で配列の連結方法
JSコード:
<script type="text/javascript">
var arr = new Array(3)
arr[0] = “Tom"
arr[1] = “John"
arr[2] = “Lucy"
var arr2 = new Array(3)
arr2[0] = “James"
arr2[1] = “Adrew"
arr2[2] = “Martin"
document.write(arr.concat(arr2))
</script>
結果
Tom,John,Lucy,James,Adrew,Martin