Fix Optional chaining doc
This commit is contained in:
parent
dccca58f26
commit
0bdf17e74b
1 changed files with 1 additions and 1 deletions
|
@ -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 `?.`:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue