3 ms·
> I don't know how you would write this in Javascript. I've written quite a lot of jQuery and know how to setup and remove callbacks. But what happens if an eve
by Normal_gaussian 10y ago
> I don't know how you would write this in Javascript. I've written quite a lot of jQuery and know how to setup and remove callbacks. But what happens if an event is triggered in the time interval between removing an event handler and adding a new one. I have no idea, and life is too short to find out.
If you are manipulating inside a single function call it is atomic, JS is single threaded and doesn't interrupt functions.