DEV Community

Discussion on: Async operations in JavaScript

 
lexlohr profile image
Alex Lohr

We should clarify which version we are talking about. If we are talking about the first implementation of JavaScript, this one was synchronous and events did interrupt the main thread.

That doesn't mean that the language itself is necessarily synchronous, but those async implementations are rather referred to as ECMAscript instead of JavaScript.

Thread Thread
 
philnash profile image
Phil Nash

I think you may be hard pressed to find anyone on this site, or even the web, who writes a post about JavaScript and means the version from Netscape 2 (without explicitly saying so).

Thread Thread
 
lexlohr profile image
Alex Lohr

Still, to the day the main thread runs completely synchronous unless you use events, Promises or async/await either directly or indirectly.

Thread Thread
 
philnash profile image
Phil Nash

Sure, if you only write synchronous code it will only run synchronously. ¯_(ツ)_/¯