split //可以将字符串分割为数组
1.split 可以分割字符串为数组,也可为几段字符串
<script>
/* split 可以将字符串分割为数组 */
var str = "hello wo";
1. var arr = str.split("");
console.log(arr); // Array(7) h,e,l,l,o,w,o
2. var arr=str.split(" ")
console.log(arr) // (2) ["jello", "world"]
3. var arr=str.split("e")
console.log(arr) // (2) ["j", "llo world"]
</script>