I wanted to write addeventlistener inside a class constructor. But then, javascript requires classMethod.bind(this) and that sometimes is annoying to be used with addeventListener because that also send 'event' to callback classMethod.
The biggest winner is
making classMethod as () => { } arrow function.
Then it wouldn't mess up your this. inside class method.
Top comments (0)