Asynchronous JavaScript — Part 1…
Let’s go back in time and look at the world’s first web-page. It was relatively dull text. Back then, it was all about sharing static-documents or text-content. If you were a web-developer, life was simple, life was good. However, as time passed, people demanded more from the web than mere static-content. They demanded a dynamic experience! — an experience where the client-server model of computing would make things more expressive and exciting.
Fast forward to the present day and for most people, the web-browser is the internet. The web-browser is a ubiquitous, all singing, all dancing window to the world. It is dynamic and exceptionally powerful. It represents decades of software development and refinement.
From the browser’s humble beginnings displaying text, we now use our web-browsers to play games, edit videos, track the economy, feed the cat, crash a drone, monitor our health and facetime people. The list is endless and we do all this ‘stuff’ asynchronously!
Asynchronous Definition: processes that operate independently.
Being asynchronous is just a fancy way to say we can do multiple things at the same time. Think of watching your favourite movie. You don’t have to watch the video, then listen to the audio. We can watch and listen at the same time. In essence, you have video and audio processes that combine to produce a better experience.
JavaScript — the Programming Language of the Web
Of all the programming languages — it is JavaScript that has cemented its legacy as the programming language of the web. JavaScript has evolved from a relatively toy language to become an extremely powerful, expressive, multi-paradigm language that dominates the client-side. Also, it is making significant progress on the server-side through node.js. If you need one language to do most things, the argument for JavaScript is strong.
Get Marc Kirk’s stories in your inbox
Join Medium for free to get updates from this writer.
JavaScript is baked into all browsers through various engines such as Chrome’s V8 and Firefox’s SpiderMonkey. If you would like to quickly experiment with JavaScript, go to your browser’s developer tools where you will find a REPL (Read Evaluate Print Loop) within the console section.
Despite JavaScript’s widespread acceptance as the programming language of the web, it may come as a shock that:
JavaScript is not asynchronous!
What? You are probably a little confused now. I too was confused. But don’t fear. In part 2 of this article, I will explain how a synchronous, blocking, single-threaded language like JavaScript can magically become asynchronous.
Spoiler — JavaScript becomes asynchronous through web APIs and something that is known as the event loop.
If you like what you read then please share and sub…










