Update article.md

This commit is contained in:
Ilya Kantor 2020-10-20 11:11:31 +03:00 committed by GitHub
parent 959dc23a9b
commit 7487ce9ebe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ alert(user.address.street); // Error!
That's the expected result. JavaScript works like this. As `user.address` is `undefined`, an attempt to get `user.address.street` fails with an error.
That said, in many practical cases we'd prefer to get `undefined` instead of an error here (meaning "no street").
In many practical cases we'd prefer to get `undefined` instead of an error here (meaning "no street").
...And another example. In the web development, we may need the information about an element on the page. We can find this element using a special method call, such as `document.querySelector('.elem')`, and it either returns an object or `null` when there's no such element.