Minor nitpick but I noticed in your event handlers you tend to use this rather than event.target, where the latter would greatly improve code clarity, modularity and DRYness since event.target will always refer to the element that dispatched the event, a.k.a the element the user interacted with, whereas this refers to the element the handler was attached to. So if you have an element that has several children expected to have the same functionality, you can simply append the event handler for that functionality to the parent and you would have fewer event listeners, which generally means less memory usage, no?
Hey! Yeah, I usually use target or currentTarget, but it reaaaaly doesn't matter that much. I've never seen any issues with memory or DRY code. Next time I re-record I'll use the event.
Minor nitpick but I noticed in your event handlers you tend to use
this
rather thanevent.target
, where the latter would greatly improve code clarity, modularity and DRYness sinceevent.target
will always refer to the element that dispatched the event, a.k.a the element the user interacted with, whereasthis
refers to the element the handler was attached to. So if you have an element that has several children expected to have the same functionality, you can simply append the event handler for that functionality to the parent and you would have fewer event listeners, which generally means less memory usage, no?