Update article.md

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

View file

@ -68,7 +68,7 @@ alert( user.address && user.address.street && user.address.street.name ); // und
AND'ing the whole path to the property ensures that all components exist (if not, the evaluation stops), but also isn't ideal.
As you can see, the property names are still duplicated in the code. E.g. in the code above, `user.address` appears three times.
As you can see, property names are still duplicated in the code. E.g. in the code above, `user.address` appears three times.
That's why the optional chaining `?.` was added to the language. To solve this problem once and for all!