Use Destructuring Assignment to Assign Variables from Objects(After long time trying to figure out the problem)

Tell us what’s happening:
I really understand destructuring assignment now. I think that i do it properly. I tried both AVG_TEMPERATURES or avgTemperatures argument and tried to find my mistake reading similar topics. I can’t get what is going wrong and the tests don’t come true.

Your code so far


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

function getTempOfTmrw(avgTemperatures) {
  "use strict";
  // change code below this line
  const { tommorow : tempOfTomorrow } = avgTemperatures ;
  // change code above this line
  return tempOfTomorrow;
}

console.log(getTempOfTmrw(AVG_TEMPERATURES)); // should be 79
const { tommorow : tempOfTomorrow } = avgTemperatures;

Check the spelling. It should be tomorrow.

1 Like

English is not my first language, rookie mistake i suppose. Really thanks about that. I spent a lot of time trying to figure the “coding” error.