MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/btxz72/what_are_some_javascript_things_beginners_dont/ep6arx6/?context=3
r/javascript • u/[deleted] • May 28 '19
383 comments sorted by
View all comments
Show parent comments
12
and you just need to execute it in the next tick (iteration of the event loop) instead.
I consider myself pretty well versed in javascript however I can not imagine what you mean with this. How would "execute it in the next tick" look in code?
3 u/archivedsofa May 28 '19 setTimeout(doSomething, 0); 4 u/ScientificBeastMode strongly typed comments May 28 '19 edited May 28 '19 setImmediate is less standard, but supposedly faster than setTimeout set to zero. It’s basically a native implementation of setTimeout( ... , 0). 8 u/ShellbertShellbach May 28 '19 Less standard? How about not standard at all? → More replies (1)
3
setTimeout(doSomething, 0);
4 u/ScientificBeastMode strongly typed comments May 28 '19 edited May 28 '19 setImmediate is less standard, but supposedly faster than setTimeout set to zero. It’s basically a native implementation of setTimeout( ... , 0). 8 u/ShellbertShellbach May 28 '19 Less standard? How about not standard at all? → More replies (1)
4
setImmediate is less standard, but supposedly faster than setTimeout set to zero. It’s basically a native implementation of setTimeout( ... , 0).
setImmediate
setTimeout
setTimeout( ... , 0)
8 u/ShellbertShellbach May 28 '19 Less standard? How about not standard at all? → More replies (1)
8
Less standard? How about not standard at all?
→ More replies (1)
12
u/ThatBriandude May 28 '19 edited May 28 '19
I consider myself pretty well versed in javascript however I can not imagine what you mean with this. How would "execute it in the next tick" look in code?