javascript-tutorial / javascript-tutorial/en.javascript.info
optional chaining: error in summary?
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
The Summary section of page https://javascript.info/optional-chaining reads:
-
obj?.prop – returns obj.prop if obj exists, otherwise undefined. -
obj?.[prop] – returns obj[prop] if obj exists, otherwise undefined. -
obj.method?.() – calls obj.method() if obj.method exists, otherwise returns undefined.
but it seems that the first 2 lines should rather say:
- ... obj.prop if obj.prop exists...
- ...obj[prop] if obj[prop] exists...
=> actually in both cases when obj does not exist, as explained before in the chapter, it will throw an error.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the optional chaining chapter at the linked javascript.info page and compare the Summary wording with the preceding explanation of property and method access. Update the two summary bullets if the explanation confirms the reported distinction, then review the rendered page to ensure the summary is accurate and clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100