Update use-destructuring-assignment-to-assign-variables-from-objects.english.md
This commit is contained in:
committed by
Kristofer Koishigawa
parent
6f09033346
commit
c9a8b38ed3
@ -68,6 +68,19 @@ console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
|
|||||||
<section id='solution'>
|
<section id='solution'>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// solution required
|
const AVG_TEMPERATURES = {
|
||||||
|
today: 77.5,
|
||||||
|
tomorrow: 79
|
||||||
|
};
|
||||||
|
|
||||||
|
function getTempOfTmrw(avgTemperatures) {
|
||||||
|
"use strict";
|
||||||
|
// change code below this line
|
||||||
|
const {tomorrow:tempOfTomorrow} = avgTemperatures; // change this line
|
||||||
|
// change code above this line
|
||||||
|
return tempOfTomorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
|
||||||
```
|
```
|
||||||
</section>
|
</section>
|
||||||
|
Reference in New Issue
Block a user