结合数组和对象解构

时间:2019-05-07 21:10:36

标签: javascript arrays object ecmascript-6

如何从数组中破坏值?

const ?? = { text: ['some text'] };

1 个答案:

答案 0 :(得分:4)

const { text: [someText]} = { text: ['some text'] };

console.log(someText);