Someone can tell me please what i'm doing wrong?

Tell us what’s happening:

someone can tell me please what i’m doing wrong?

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

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

Hey,

You’re not using the function parameter avgTemperatures of your function getTempOfTmrw and instead, you’re using the constant AVG_TEMPERATURES.

Take a look at this line

const {tomorrow: tempOfTomorrow} = AVG_TEMPERATURES; // change this line

Should look like

const {tomorrow: tempOfTomorrow} = avgTemperatures; // change this line

While running that code in the browser would work it defeats the purpose of having a parameter and does not comply with the test destructuring with reassignment was used.

Edit:

Reassignment would mean to assign your original variable/const to another one, in this case by calling a function with AVG_TEMPERATURES you’re assigning it to the parameter avgTemperatures, hence reassignment