From de4f81e792b8fe42977854723deef4ee33b7dddb Mon Sep 17 00:00:00 2001 From: Gleb Date: Wed, 30 Mar 2022 13:51:54 +0400 Subject: [PATCH] Update optional-chaining/article.md `?.` returns `undefined` --- 1-js/04-object-basics/07-optional-chaining/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/04-object-basics/07-optional-chaining/article.md b/1-js/04-object-basics/07-optional-chaining/article.md index 5bcaba59..51cf195b 100644 --- a/1-js/04-object-basics/07-optional-chaining/article.md +++ b/1-js/04-object-basics/07-optional-chaining/article.md @@ -103,7 +103,7 @@ The code is short and clean, there's no duplication at all. Here's an example with `document.querySelector`: ```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: