Merge pull request #2936 from glebmikulko/patch-4
Update optional-chaining/article.md
This commit is contained in:
commit
094b15b505
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ The code is short and clean, there's no duplication at all.
|
||||||
Here's an example with `document.querySelector`:
|
Here's an example with `document.querySelector`:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
let html = document.querySelector('.elem')?.innerHTML; // will be null, if there's no element
|
let html = document.querySelector('.elem')?.innerHTML; // will be undefined, if there's no element
|
||||||
```
|
```
|
||||||
|
|
||||||
Reading the address with `user?.address` works even if `user` object doesn't exist:
|
Reading the address with `user?.address` works even if `user` object doesn't exist:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue