title |
localeTitle |
Use Destructuring Assignment to Assign Variables from Nested Objects |
使用解构分配从嵌套对象分配变量 |
使用解构分配从嵌套对象分配变量
提示通过最终测试:使用_嵌套解构_
测试希望您仅获得max
和max
。如果你将常量解构为包含max
和min
,则测试将失败。
扰流板!
这是代码解决方案:
const { tomorrow: { max: maxOfTomorrow } } = forecast;