2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Accessing Object Properties with Bracket Notation
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Accessing Object Properties with Bracket Notation
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
```js
|
|
|
|
var testObj = {
|
|
|
|
"an entree": "hamburger",
|
|
|
|
"my side": "veggies",
|
|
|
|
"the drink": "water"
|
|
|
|
};
|
|
|
|
|
|
|
|
// Only change code below this line
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
var entreeValue = testObj["an entree"]; // Change this line
|
|
|
|
var drinkValue = testObj["the drink"]; // Change this line
|
2018-10-12 15:37:13 -04:00
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
</details>
|