Use Destructuring Assignment to Assign Variables from Objects asigning problem

Use Destructuring Assignment to Assign Variables from Objects asigning problem
0

#1

**Tell us what’s happening"
I don’t understand that assigning statement ?
How to asign please Help

Your code so far


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

function getTempOfTmrw(avgTemperatures) {
  "use strict";
  // change code below this line
  const { 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; rv:62.0) Gecko/20100101 Firefox/62.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects


#2

You’re using the test object, you need to use the parameter given to the function. AVG_TEMPERATURES is just there to check your code works

Edit: with your code, if I do

getTempOfTmrw({ today: 62, tomorrow: 65})

I get a temperature of 79 for tomorrow, which is wrong, the return value should be 65