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

  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:

The text that appears in the console are just the tests which failed. So, you failed the test which checks if maxOfTomorrow equals 84.6 and you failed the test that checks that nested destructuring was used.

It is a little confusing and I believe they are working on changing how this information gets display to avoid the confusion.

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

Thanks for the help @RandellDawson 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.

The challenge test is looking for the minimum code to solve the problem. You do not need to include the min property, because it is not relevant to solve this challenge. Technically, your code is correct and will assign 84.6 to maxOfTomorrow, but the test is not expecting to see the extra code. Could the test be written to allow the min property? Probably. You can open a new Issue on gitbhub if one is not already been opened.


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

Use this one ,

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