const AVG_TEMPERATURES = {
today: 77.5,
tomorrow: 79
};
function getTempOfTmrw(avgTemperatures) {
"use strict";
// change code below this line
let tempOfTomorrow = undefined;
const {tomorrow} = avgTemperatures; // change this line
tempOfTomorrow = tomorrow;
// change code above this line
return tempOfTomorrow;
}
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
I get error destructuring with reassignment was used.
you need to do it all in one line, and not declare tempOfTomorrow in the previous line (also you don’t need to explicity assign a value of undefined to a variable, as that is the default value)