Merge pull request #2259 from satyambnsal/master

Fix Optional chaining doc
This commit is contained in:
Ilya Kantor 2020-11-10 12:05:59 +03:00 committed by GitHub
commit f782e9c962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ The optional chaining `?.` stops the evaluation if the part before `?.` is `unde
In other words, `value?.prop`: In other words, `value?.prop`:
- is the same as `value.prop` if `value` exists, - is the same as `value.prop` if `value` exists,
- otherwise (when `value` is `undefined/null`) it returns that `value`. - otherwise (when `value` is `undefined/null`) it returns `undefined`.
Here's the safe way to access `user.address.street` using `?.`: Here's the safe way to access `user.address.street` using `?.`: