Fix Optional chaining doc

This commit is contained in:
satyam bansal 2020-11-01 17:59:28 +05:30 committed by GitHub
parent dccca58f26
commit 0bdf17e74b
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 `?.`: