JS string destructuring: rest parameter returning inconsistent data

前端 未结 0 1081
误落风尘
误落风尘 2020-12-19 15:09

Consider the following examples

An old project:

const [x, ...y] = "text";
console.log(x) // "t"
console.log(y) // "ext"
<         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题