Nested destructuring

Tell us what’s happening:

what’s wrong with me?

Your code so far

  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}} = LOCAL_FORECAST; // change this line
  // change code above this line
  return maxOfTomorrow;

console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

I don’t think anything is wrong with you, but in your code, you are referencing the global variable LOCAL_FORECAST instead referencing the argument passed into the getMaxOfTmrw function. The instructions specifically state for you to “to obtain max of forecast.tomorrow”. forecast is the argument passed to the function.

1 Like