Use Destructuring Assignment to Assign Variables from Nested Objects - recurring error

Tell us what’s happening:
I am not really sure what is happening, on the console, it wrote:
maxOfTomorrow equals 84.6
nested destructuring was used

but in the tests check, both failed.

This recurred for the previous test also.

Your code so far


const LOCAL_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: {min, maxOfTomorrow}} = forecast; // change this line
 // const maxOfTomorrow = max;
  // change code above this line
  return maxOfTomorrow;
}

console.log(getMaxOfTmrw(LOCAL_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/67.0.3396.87 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

You’ll need to store the value of max into maxOfTomorrow

Thanks for the help @camperextraordinaire and @mjbenefiel

So I replaced the line with this:

const {tomorrow: {min, max:maxOfTomorrow}} = forecast;

and still got this on the console:

nested destructuring was used

this error is what is bothering me the most because I don’t really know what is causing it.

console log shows 84.6, so I’m not 100% sure why that solution won’t pass. I know some of these ES6 challenges have bugs.

I try to read these challenges in their most literal sense, and did not include min the first time I passed the challenge. Sorry I couldn’t go more in depth here, but maybe I saved you some frustration that some of these newer challenges pose.

Thanks!

That strict requirement is confusing for someone who is still learning the ropes to this.

Use this one ,

const {tomorrow: { max:maxOfTomorrow}} = forecast;