0 votes
in JavaScript by
How do you implement zero timeout in modern browsers?

1 Answer

0 votes
by

You can't use setTimeout(fn, 0) to execute the code immediately due to minimum delay of greater than 0ms. But you can use window.postMessage() to achieve this behavior.

...