From ab92e31f3907787ca1a383775d1328147e2f2d9f Mon Sep 17 00:00:00 2001 From: Peter Roche <46547072+paroche@users.noreply.github.com> Date: Tue, 19 Nov 2019 00:05:59 -0700 Subject: [PATCH] Update article.md 'add same handling' -> 'add the same handling' 'and alike' -> 'and the like' 'if' -> 'whether' --- 2-ui/2-events/03-event-delegation/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2-ui/2-events/03-event-delegation/article.md b/2-ui/2-events/03-event-delegation/article.md index e91a0bf66c..3d8beda0f4 100644 --- a/2-ui/2-events/03-event-delegation/article.md +++ b/2-ui/2-events/03-event-delegation/article.md @@ -248,7 +248,7 @@ The "behavior" pattern can be an alternative to mini-fragments of JavaScript. Event delegation is really cool! It's one of the most helpful patterns for DOM events. -It's often used to add same handling for many similar elements, but not only for that. +It's often used to add the same handling for many similar elements, but not only for that. The algorithm: @@ -261,12 +261,12 @@ Benefits: ```compare + Simplifies initialization and saves memory: no need to add many handlers. + Less code: when adding or removing elements, no need to add/remove handlers. -+ DOM modifications: we can mass add/remove elements with `innerHTML` and alike. ++ DOM modifications: we can mass add/remove elements with `innerHTML` and the like. ``` The delegation has its limitations of course: ```compare - First, the event must be bubbling. Some events do not bubble. Also, low-level handlers should not use `event.stopPropagation()`. -- Second, the delegation may add CPU load, because the container-level handler reacts on events in any place of the container, no matter if they interest us or not. But usually the load is negligible, so we don't take it into account. +- Second, the delegation may add CPU load, because the container-level handler reacts on events in any place of the container, no matter whether they interest us or not. But usually the load is negligible, so we don't take it into account. ```