Files

29 lines
550 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Use Destructuring Assignment to Assign Variables from Objects
---
# Use Destructuring Assignment to Assign Variables from Objects
2018-10-12 15:37:13 -04:00
---
## Solutions
<details><summary>Solution 1 (Click to Show/Hide)</summary>
```javascript
const HIGH_TEMPERATURES = {
yesterday: 75,
today: 77,
tomorrow: 80
};
// change code below this line
const { today: highToday, tomorrow: highTomorrow } = HIGH_TEMPERATURES;
// change code above this line
2018-10-12 15:37:13 -04:00
console.log(highToday); // should be 77
console.log(highTomorrow); // should be 80
```
2018-10-12 15:37:13 -04:00
</details>