/*
第4种情况,用slice能实现“a&bb&cc&d”吗?
*/
let arr = ['a', ['bb','cc'], 'd'];
let ret = arr.join();
//1
console.log(ret); //"a,bb,cc,d", 与arr.join(',');一样
//2
let ret _1= arr.join('');
console.log(ret_1); //abb,ccd
//3
let ret _2= arr.join(','); //"a,bb,cc,d", 同arr.join();
console.log(ret_2);
//4
let ret _3= arr.join('&');
console.log(ret_3); //a&bb, cc&d
添加回答
举报
0/150
提交
取消