2023-08-11T14:11:55.png

var a = "h|el|lo";
var b = "hello";

//指定分隔符进行分割
console.log(a.split("|"));

//分割每个字符
console.log(b.split(""));

//空参数,返回原字符
console.log(b.split());


//分割每个字符,但设置长度,只保留前面3个内容
console.log(b.split("",3));