This question is regarding setTimeout method in JavaScript. Is there some kind of benefit to calling another function inside a setTimeout after zero seconds? Like so,
setTimeout(func, 0);
The reason why i'm asking is because I have noticed similar lines of code in certain plugin/libraries(for example, checkout offloadFn function in swipejs). Is it to support some kind of browser incompatibility or is it just bad way to write code and I should totally ignore it? I would love to know if there is some kind of benefit. Thank you for your time in advance.