Can not pass quiz ES6: Use Destructuring Assignment to Assign Variables from Objects

Hello every one :smiley:

Can not pass quiz …
link to quiz https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects/
in console print error : destructuring with reassignment was used
what is wrong with code ?

const AVG_TEMPERATURES = {
  today: 77.5,
  tomorrow: 79
};

function getTempOfTmrw(avgTemperatures) {
  "use strict";
  // change code below this line
  const {today: a ,tomorrow: b } = AVG_TEMPERATURES;
  
  const tempOfTomorrow = b; // change this line
  
  // change code above this line
  return tempOfTomorrow;
}



console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79

First of all, you are passing AVG_TEMPERATURES object into a function, so on line 3 you should use function parameter. And you only need to destructure tempOfTomorrow not all properties of AVG_TEMPERATURES object.

so the correct way to do this is,
working code: const { tomorrow: tempOfTomorrow } = avgTemperatures;

You will pass your test with the above code.

Thank you :grinning: