From b4910970c2aeab26ab81242f94dc1fc7b600475a Mon Sep 17 00:00:00 2001 From: Violet Bora Lee Date: Tue, 5 May 2020 22:27:01 +0900 Subject: [PATCH] minor fixes --- 1-js/04-object-basics/07-optional-chaining/article.md | 4 ++-- 2-ui/2-events/05-dispatch-events/article.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 d2fdf948..f136b957 100644 --- a/1-js/04-object-basics/07-optional-chaining/article.md +++ b/1-js/04-object-basics/07-optional-chaining/article.md @@ -3,7 +3,7 @@ [recent browser="new"] -The optional chaining `?.` is an error-prone way to access nested object properties, even if an intermediate property doesn't exist. +The optional chaining `?.` is an error-proof way to access nested object properties, even if an intermediate property doesn't exist. ## The problem @@ -40,7 +40,7 @@ AND'ing the whole path to the property ensures that all components exist, but is The optional chaining `?.` stops the evaluation and returns `undefined` if the part before `?.` is `undefined` or `null`. -Further in this article, for brewity, we'll be saying that something "exists" if it's not `null` and not `undefined`. +Further in this article, for brevity, we'll be saying that something "exists" if it's not `null` and not `undefined`. Here's the safe way to access `user.address.street`: diff --git a/2-ui/2-events/05-dispatch-events/article.md b/2-ui/2-events/05-dispatch-events/article.md index 8bc7ed27..1a8e92ef 100644 --- a/2-ui/2-events/05-dispatch-events/article.md +++ b/2-ui/2-events/05-dispatch-events/article.md @@ -243,9 +243,9 @@ The output order is: 1 -> nested -> 2. Please note that the nested event `menu-open` is caught on the `document`. The propagation and handling of the nested event is finished before the processing gets back to the outer code (`onclick`). -That's not only about `dispatchEvent`, there are other cases. If an event handler calls methods that trigger to other events -- they are too processed synchronously, in a nested fasion. +That's not only about `dispatchEvent`, there are other cases. If an event handler calls methods that trigger to other events -- they are too processed synchronously, in a nested fashion. -Let's say we don't like it. We'd want `onclick` to be fully processed first, independantly from `menu-open` or any other nested events. +Let's say we don't like it. We'd want `onclick` to be fully processed first, independently from `menu-open` or any other nested events. Then we can either put the `dispatchEvent` (or another event-triggering call) at the end of `onclick` or, maybe better, wrap it in the zero-delay `setTimeout`: