Predict Nested 对象 Access
预测输出 简单
题目
什么做 这个 code print?
代码
const data = {
user: {
address: {
city: "Portland"
}
}
};
console.log(data.user.address.city);
提示
链点 notation 到 access nested 属性.
解释
Chained 点 notation accesses nested 属性: 数据.用户 gives 用户对象, .地址 gives 地址对象, and .city gives "Portland". 每个步骤 drills one level deeper 到 nested 结构.
相关资源
相关课程
- JavaScript 对象
学习关于 nested 对象.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。