Use Destructuring Assignment to Assign Variables from Objects help?

Tell us what’s happening:
i am not able to understand reassignment. please help

Your code so far

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

console.log(getTempOfTmrw(b)); // 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/74.0.3729.131 Safari/537.36.

Link to the challenge:

Two things:

1 - You have changed the function call, better avoid that and stick to what the lesson gives to you


2 - The lesson asks you to use destructuring with assignment inline inside the function, so don’t use global variables but leverage the function arguments and destructuring.

So this

 const tempOfTomorrow = b; // change this line

Should more likely looks something like [a hint, not the solution]

const { key: newAssignment } = objectPassedAsArg

Hope this helps :+1:
Btw you got the idea of how destricturing and assigning works, now it’s more a matter of making it compliant to FCC request