Use Destdestructuring Assignment: stuck with prompted error

Tell us what’s happening:

My response return the required value (79), but console prompts that I’m not usign destructuring with reassignment.

Your code so far

//MY ANSWER

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 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.119.

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

you are in a function- why are you not using the function parameter?

2 Likes

Thank you. I solved it