Home  >  Article  >  Web Front-end  >  javascript数组组合成字符串的脚本_javascript技巧

javascript数组组合成字符串的脚本_javascript技巧

WBOY
WBOYOriginal
2016-05-16 19:07:371420browse

在某些程序中,你可能需要将数组组合成字符串,比如将var aArray = ["a","b","c"];处理成字符串的形式。这里有两种方法,当然如果你有更好的办法,别忘记留言给我。
第一种:
aArray.toString()
第二种:
aArray + ""
演示:


[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn