Posted in Javascript onMarch 20, 2015
本文实例讲述了JavaScript通过join函数连接数组里所有元素的方法。分享给大家供大家参考。具体实现方法如下:
<script type="text/javascript"> var days = ["Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"]; document.write("days:"+days.join(",")); </script>
输出结果如下:
days:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
希望本文所述对大家的javascript程序设计有所帮助。
JavaScript通过join函数连接数组里所有元素的方法
- Author -
work24声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@