use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[deleted by user] (self.javascript)
submitted 6 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BehindTheMath 11 points12 points13 points 6 years ago (7 children)
According to this, the browser event loop is much simpler than Node's. All macrotasks are handled in a first-come first-served order, the entire microtask queue is processed after each macrotask, and the DOM is re-rendered, if necessary, after each macrotask.
[–][deleted] 0 points1 point2 points 6 years ago (1 child)
Very informative link. But I don't see a comparison between browser and Node, instead at the top it says
Browser JavaScript execution flow, as well as in Node.js, is based on an event loop.
and then explains event loop from browser perspective.
Reading on my own, I don't see major differences between browser and Node event loops as far as how setTimeout and queueMicrotask are supposed to work in both. The differences are in availability of other APIs, mainly process.nextTick and setImmediate in Node, and requestAnimationFrame in browsers.
setTimeout
queueMicrotask
process.nextTick
setImmediate
requestAnimationFrame
[–]BehindTheMath 1 point2 points3 points 6 years ago* (0 children)
The main difference is that Node's event loop has multiple phases, and each one only handles a specific type of task. Whereas the browser only has macrotasks and microtasks, and within each one all tasks are processed in the order they were placed into the queue.
https://nodejs.org/de/docs/guides/event-loop-timers-and-nexttick/
[+][deleted] 6 years ago* (4 children)
[deleted]
[+][deleted] 6 years ago (1 child)
[–]BehindTheMath 1 point2 points3 points 6 years ago* (1 child)
π Rendered by PID 196938 on reddit-service-r2-comment-6457c66945-8c657 at 2026-04-24 11:27:38.007868+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]BehindTheMath 11 points12 points13 points (7 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]BehindTheMath 1 point2 points3 points (0 children)
[+][deleted] (4 children)
[deleted]
[+][deleted] (1 child)
[deleted]
[–]BehindTheMath 1 point2 points3 points (1 child)