2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Accessing Object Properties with Dot Notation
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Accessing Object Properties with Dot Notation
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
```js
|
|
|
|
var testObj = {
|
2019-07-24 00:59:27 -07:00
|
|
|
hat: "ballcap",
|
|
|
|
shirt: "jersey",
|
|
|
|
shoes: "cleats"
|
2018-10-12 15:37:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Only change code below this line
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
var hatValue = testObj.hat; // Change this line
|
|
|
|
var shirtValue = testObj.shirt; // Change this line
|
2018-10-12 15:37:13 -04:00
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
</details>
|