定义和用法
join() 方法用于把数组中的所有元素放入一个字符串。
元素是通过指定的分隔符进行分隔的。
<script type="text/javascript">var arr = new Array(3)arr[0] = "George"arr[1] = "John"arr[2] = "Thomas"document.write(arr.join())</script>
George,John,Thomas
<script type="text/javascript">var arr = new Array(3)arr[0] = "George"arr[1] = "John"arr[2] = "Thomas"document.write(arr.join("."))</script>
George.John.Thomas
JS的join方法
原文地址:http://www.cnblogs.com/mr-wuxiansheng/p/7466071.html