Relying on specific timeouts is bad yes, in this case all we need is to push off to a future tick of the event loop and
setTimeout of 0 is a perfectly safe way of doing that, though there is an alternate API we could use to do the same thing instead.