Skip to content

Commit 030decc

Browse files
authored
Update article.md
1 parent d6e8864 commit 030decc

File tree

1 file changed

+4
-2
lines changed
  • 1-js/04-object-basics/07-optional-chaining

1 file changed

+4
-2
lines changed

1-js/04-object-basics/07-optional-chaining/article.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ The optional chaining `?.` is a safe way to access nested object properties, eve
99

1010
If you've just started to read the tutorial and learn JavaScript, maybe the problem hasn't touched you yet, but it's quite common.
1111

12-
As an example, consider objects for user data. Most of our users have addresses in `user.address` property, with the street `user.address.street`, but some did not provide them.
12+
As an example, consider objects that hold user data.
1313

14-
In such case, when we attempt to get `user.address.street`, we may get an error:
14+
Most of our users have addresses in `user.address` property, with the street `user.address.street`, but some did not provide them.
15+
16+
In such case, when we attempt to get `user.address.street` of a user, and there's no address, then we get an error:
1517

1618
```js run
1719
let user = {}; // a user without "address" property

0 commit comments

Comments
 (0)