freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../basic-javascript/accessing-object-properties.../index.md

21 lines
440 B
Markdown
Raw Normal View History

---
title: Accessing Object Properties with Dot Notation
localeTitle: 使用点表示法访问对象属性
---
## 使用点表示法访问对象属性
这是一个可能的解决方案:
```js
var testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
};
// Only change code below this line
var hatValue = testObj.hat; // Change this line
var shirtValue = testObj.shirt; // Change this line
```