NO , its not passing in free code camp its showing error in console like
“nested destructuring was used” i want to know why
(when i am changing forecast to LOCAL_FORECAST )
AND I REMOVED THE USE STRICT ALSO
Well, it looks like it doesn’t want nested destructuring. It probably wants this:
const {max: maxOfTomorrow} = forecast.tomorrow;
But, it’s weird you’re getting that error because it says it wants it to be nested destructuring.
Also, your code passes for me. Are you using Chrome?
forecast is the function parameter, and you use that to make your function reusable. LOCAL_FORECAST is a global object, which is passed in the function as argument in the function call at the bottom of the code
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
Can you share with us what browser and what version you are using? Also, can you post a screen shot of what the FCC console shows when you click Run Tests?
i am using CROME browser
and this is my code (currently working )
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; // i have a problem in understanding this line (why forecast and why not LOCAL_FORECAST
// change code above this line
return maxOfTomorrow;
}
console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6
and in console i am getting correct value .
i just want to know that when i am changing forecast to LOCAL_FORECAST whats happening in that line ehere i am using nested destructring …