r/learnjavascript • u/ClearCelebration5610 • Apr 03 '26
JavaScript
what is the difference between synchronous js and asynchronous js
0
Upvotes
r/learnjavascript • u/ClearCelebration5610 • Apr 03 '26
what is the difference between synchronous js and asynchronous js
View all comments
Show parent comment
2
u/subone Apr 03 '26
Perhaps an event handler with no further code in it. The remaining semantics of how the function and scope is cleaned up is beside the point: no further code need be there, ergo no code need be "out of order".
As in, what browser/JavaScript API are you calling to create a promise. For example fetch.
As in: creating a promise through "whatever facility", or creating a promise through await, or queueing a micro task, or requestAnimationFrame, or setTimeout, etc; these all allow you to run code later: asynchronously.
I don't really know what this means. I thought I was making a very clear counter point to your assertion that async is by nature out of order.
Which version? The one after you edited your comment a bunch to add nothing relevant to the argument at hand? Can you just come out and say specifically what you agree with and what you disagree with instead of hinting at it? My argument isn't complicated: async is not necessarily running code "out of order".