4 ms·
You could do: var boundEvent = handleEvent.bind(this); document.addEventListener('click', boundEvent); and later: document.removeEventListener('c
by timothya 13y ago
You could do:
var boundEvent = handleEvent.bind(this);
document.addEventListener('click', boundEvent);
and later:
document.removeEventListener('click', boundEvent);
This situation is a bit messier, though, because you have to keep track of both `handleEvent` and `boundEvent`.
- cocoflunchy 13y agoNow it seems obvious... thank you ;)