Update use-destructuring-assignment-to-assign-variables-from-nested-objects.english.md
This commit is contained in:
parent
25fd2b726a
commit
d7810f6ab4
@ -63,6 +63,19 @@ console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6
|
||||
<section id='solution'>
|
||||
|
||||
```js
|
||||
// solution required
|
||||
const LOCAL_FORECAST = {
|
||||
today: { min: 72, max: 83 },
|
||||
tomorrow: { min: 73.3, max: 84.6 }
|
||||
};
|
||||
|
||||
function getMaxOfTmrw(forecast) {
|
||||
"use strict";
|
||||
// change code below this line
|
||||
const {tomorrow : {max : maxOfTomorrow}} = forecast; // change this line
|
||||
// change code above this line
|
||||
return maxOfTomorrow;
|
||||
}
|
||||
|
||||
console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6
|
||||
```
|
||||
</section>
|
||||
|
Loading…
x
Reference in New Issue
Block a user