Use Destructuring Assignment to Assign Variables from Objects? Please help

I think gotten the answer correct, but it’s popping an error saying destructuring with reassignment was used.

The problem is:
Use destructuring to obtain the average temperature for tomorrow from the input object AVG_TEMPERATURES , and assign value with key tomorrow to tempOfTomorrow in line.

Your code so far

  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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.

Hint: Your function is given an argument variable avgTemperatures, but you aren’t using it anywhere.


Thanks! Now I got it. Was making the same mistake in the next challenge too.

I’m glad I could help. Happy coding!