javscript 数组转换为字符串,以符号分割;链接字符;截取
//数组转换成字符串
var arr=['a','b','c'];
console.log(arr.toString());//a,b,c
//数组以分隔符分割
var arr=['a','b','c'];
console.log(arr.join('|'));//a|b|c
//链接三个字符串
var arr1=['a','b','c'];
var arr2=['r','d','g'];
var arr3=['ee','rr'];
console.log(arr1.concat(arr2).concat(arr3));
//截取(从下标开始,下标结束)的值
var arr1=['a','b','c','d'];
console.log(arr1.slice(1,2));//b
//截取(从下标开始,截取几个)会破坏原数组
var arr1=['a','b','c','d'];
console.log(arr1.splice(0,2));//a,b
console.log(arr1);//c,d