const AVG_TEMPERATURES = {
today: 77.5,
tomorrow: 79
};
function getTempOfTmrw(avgTemperatures) {
"use strict";
// change code below this line
const {today: tempOfToday,tomorrow:tempOfTomorrow} = AVG_TEMPERATURES; // change this line
// change code above this line
return tempOfTomorrow;
}
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
I will provide full solution because is more a bug on testing and not a spoiler solution.
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
This has pas the test, copy this code and should work.
I believe that the server when is testing the input is expecting you to change ONLY line nr 9 const tempOfTomorrow = undefined; // change this line;
to const {tomorrow:tempOfTomorrow} = avgTemperatures;
and nothing else.
@ankitchawrai, inside the function you are not using the argument you provide (avgTemperatures) but rather the AVG_TEMPERATURES object which the function getTempOfTmrw doesn’t know about.