js 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
原文地址:https://www.cnblogs.com/shiyunfront/p/7337769.html