Fuwwy
October 21, 2022, 4:21pm
1
The assignment “Use Destructuring Assignment to Assign Variables from Nested Objects ” uses a regex that does not support leading-comma destructuring (such as { property: alias, /* ← this */ }).
The lowToday and highToday test case regexes should be updated to include this syntax: /(var|const|let)\s*{\s*today\s*:\s*{\s*(high\s*:\s*highToday[^}]*|[^,]*,\s*high\s*:\s*highToday,?\s*)}\s*}\s*=\s*LOCAL_FORECAST(;|\s+|\/\/)/g
(changed highToday\s*
to highToday,?\s*
)
It half supports adding extra unneeded commas. Should be an easy fix.
freeCodeCamp:main
← jeremylt:jeremy/moar-commas
opened 04:46PM - 21 Oct 22 UTC
Checklist:
- [x] I have read [freeCodeCamp's contribution guidelines](htt… ps://contribute.freecodecamp.org).
- [x] My pull request has a descriptive title (not a vague title like `Update index.md`)
- [x] My pull request targets the `main` branch of freeCodeCamp.
- [x] I have tested these changes either locally on my machine, or GitPod.
Closes #XXXXX
Reported on the forum: https://forum.freecodecamp.org/t/update-a-lessons-test-to-support-trailing-commas/565194
system
Closed
April 22, 2023, 4:27am
3
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.