Use Destructuring Assignment to Assign Variables from Nested Objects : this challenge is throwing error upon completing it

Tell us what’s happening:

Your code so far


const forecast = {
  today: { min: 72, max: 83 },
  tomorrow: { min: 73.3, max: 84.6 }
};

function getMaxOfTmrw(forecast) {
  "use strict";
  // change code below this line
  const{tomorrow:{max:maxOfTomorrow}}=forecast; // change this line
  // change code above this line
  return maxOfTomorrow;
}

console.log(getMaxOfTmrw(forecast)); // should be 84.6

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36.

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

Copy-pasting your function will pass the challenge^^ The problem is that you modified the original code ( you renamed the argument the same as the parameter).
Just reset your code through the reset all code button and use the same function^^

thanks fixed it already

1 Like