<script type="text/javascript">
var arr = [2,3,4,5,6];
var str = "bacadaeaf";
console.log(arr.join(""));//23456
console.log(arr.join("1"));//213141516
console.log(arr.join("1").split("1"));//["2", "3", "4", "5", "6"]
console.log(str.split(""));//["b", "a", "c", "a", "d", "a", "e", "a", "f"]
console.log(str.split("a"));//["b", "c", "d", "e", "f"]
console.log(str.split("a").join("a"));//bacadaeaf
</script>
网友评论