ES6: Use Destructuring Assignment (Test does not recognize solution)
See original GitHub issueDescribe 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
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:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@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
toforecast
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.