DEV Community

Discussion on: TIL – addEventListener accepts functions and (!) objects

Collapse
 
kacluk123 profile image
Kacper Łukasik

This will create a new instance of EventHandler by every click?

Collapse
 
garrettmills profile image
Garrett Mills

No. The EventHandler is instantiated once when the addEventListener method is called. So, the same EventHandler instance will be re-used for each trigger.