Second test case not passed : destructuring with reassignment was used

Tell us what’s happening:

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 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/

Look here:

I will say only destructure the one they are asking for and make sure you pull them out of whats being passed into the function and not the variables above.

Thanks , now I got it.

1 Like

Thanks. After re-reading this and listening carefully, I finally got it to pass. I can be a bit borg brained at times.