Predict 对象 Access 输出
预测输出 简单
题目
什么做 这个 code print?
代码
const person = { name: "Ada", age: 36 };
console.log(person.name);
console.log(person["age"]);
提示
两者都点 notation and bracket notation access 属性.
解释
person.name uses dot notation to get "Ada". person["age"] uses bracket notation to get 36. Both notations access the same property. The output is: Ada (first line) and 36 (second line).
相关资源
相关课程
- 对象
学习如何对象分组 related 数据使用键 and 值.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。