question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES6: Use Destructuring Assignment (Test does not recognize solution)

See original GitHub issue

Describe your problem and - if possible - how to reproduce it

On Problem: ES6: Use Destructuring Assignment to Assign Variables from Nested Objects

I’ve added the solution const { tomorrow: { max: maxOfTomorrow } } = LOCAL_FORECAST;

as explained in the hints but the second test: nested destructuring was used does not recognize the nested destructuring

Add a Link to the page with the problem

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

Tell us about your browser and operating system

  • Browser Name: Chrome
  • Browser Version: 68.0.3440.106 (64-bit)
  • Operating System: Ubuntu 17.10

If possible, add a screenshot here

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
joshallingcommented, Feb 21, 2019

@RandellDawson I think this should have been closed a long time ago, as the curriculum was always working as intended. The issue was that the guide article was wrong.

1reaction
joshallingcommented, Aug 23, 2018

@rmfranciacastillo It looks like you are destructing the constant rather than using the passed parameter in your function. This means that your function will always return 84.6 regardless of what is passed. Change LOCAL_FORECAST to forecast and you should be good.

It might be a good idea to update the test to use a different object so that the first test doesn’t pass by coincidence as it did in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Destructuring assignment cannot recognize a declared variable
My origin test, try to assign 2 numbers to the object. let obj = {} let num = 100 let tar = 200...
Read more >
ES6: Use Destructuring Assignment to Assign Variables from ...
The problem is that you are not using the function parameter. Rather you directly use the variable. To pass the test you need...
Read more >
Use Destructuring Assignment to Extract Values from Objects ...
In this JavaScript ES6 tutorial we use destructuring assignment to extract values from objects. This is one part of a multi-part series ...
Read more >
ES6 - Use Destructuring Assignment to Assign Variables from ...
In this JavaScript ES6 tutorial we use destructuring assignment to assign variables from nested objects. This is one part of a multi-part ...
Read more >
ES6 - Use Destructuring Assignment with the Rest Parameter ...
In this JavaScript ES6 tutorial we use destructuring assignment with the rest parameter to reassign array elements. This is one part of a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found