💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] >[success] # 混合解构 ~~~ '对象与数组解构'能被用在一起,以创建更复杂的解构表达式。在'对象'与'数组混合'而成的结构中,这么做便能 准确提取其中你想要的信息片段。例如: ~~~ ~~~ let node = { type: "Identifier", name: "foo", loc: { start: { line: 1, column: 1 }, end: { line: 1, column: 4 } }, range: [0, 3] }; let { loc: { start }, range: [startIndex] } = node console.log(start.line) // 1 console.log(start.column) // 1 console.log(startIndex) // 0 ~~~