Tell us what’s happening:
I’m stuck in this challange. As far as I know I’ve done what it asks to do. It actually works and the system marks that the expected answer is correct but “destructuring with reassignment was used” is marked wrong, even when I wrote the structure they taught in this lesson. I don’t know what I’m missing.
Your code so far
const AVG_TEMPERATURES = {
today: 77.5,
tomorrow: 79
};
function getTempOfTmrw(tomorrow) {
"use strict";
// change code below this line
const {today : tempOfToday, tomorrow : tempOfTomorrow} = AVG_TEMPERATURES;
// change code above this line
return tempOfTomorrow;
}
console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects/