freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../es6/use-destructuring-assignmen.../index.md

476 B
Raw Blame History

title localeTitle
Use Destructuring Assignment to Assign Variables from Nested Objects 使用解构分配从嵌套对象分配变量

使用解构分配从嵌套对象分配变量

提示通过最终测试使用_嵌套解构_

测试希望您仅获得maxmax 。如果你将常量解构为包含maxmin ,则测试将失败。

扰流板!

这是代码解决方案:

const { tomorrow: { max: maxOfTomorrow } } = forecast;