Update article.md

Rephrasing what does delegation do for us question.
This commit is contained in:
Peter Roche 2019-11-18 23:42:34 -07:00 committed by GitHub
parent e515f80a9f
commit 2e7350599a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,7 @@ The handler reads the attribute and executes the method. Take a look at the work
Please note that `this.onClick` is bound to `this` in `(*)`. That's important, because otherwise `this` inside it would reference the DOM element (`elem`), not the `Menu` object, and `this[action]` would not be what we need.
So, what the delegation gives us here?
So, what advantages does delegation give us here?
```compare
+ We don't need to write the code to assign a handler to each button. Just make a method and put it in the markup.