Skip to content

Commit ab92e31

Browse files
authored
Update article.md
'add same handling' -> 'add the same handling' 'and alike' -> 'and the like' 'if' -> 'whether'
1 parent 6599fa9 commit ab92e31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: 2-ui/2-events/03-event-delegation/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ The "behavior" pattern can be an alternative to mini-fragments of JavaScript.
248248

249249
Event delegation is really cool! It's one of the most helpful patterns for DOM events.
250250

251-
It's often used to add same handling for many similar elements, but not only for that.
251+
It's often used to add the same handling for many similar elements, but not only for that.
252252

253253
The algorithm:
254254

@@ -261,12 +261,12 @@ Benefits:
261261
```compare
262262
+ Simplifies initialization and saves memory: no need to add many handlers.
263263
+ Less code: when adding or removing elements, no need to add/remove handlers.
264-
+ DOM modifications: we can mass add/remove elements with `innerHTML` and alike.
264+
+ DOM modifications: we can mass add/remove elements with `innerHTML` and the like.
265265
```
266266

267267
The delegation has its limitations of course:
268268

269269
```compare
270270
- First, the event must be bubbling. Some events do not bubble. Also, low-level handlers should not use `event.stopPropagation()`.
271-
- 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.
271+
- 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.
272272
```

0 commit comments

Comments
 (0)