const str = 'i am the stone bone'
const [a,b,c,...oth] = str
console.log("TCL: a,b,c,...oth", a,b,c,...oth) //一个是一个字符
const {length,split} = str
解构赋值获取字符串长度,注意const后面跟着的是花括号
最新推荐文章于 2024-03-28 00:45:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
const str = 'i am the stone bone'
const [a,b,c,...oth] = str
console.log("TCL: a,b,c,...oth", a,b,c,...oth) //一个是一个字符
const {length,split} = str