Asynchronous Programming
Out of all chapters in this book, this is my favorite, because I've faced the consequences of bad asynchronous programming in the past, with callbacks on event listeners, HTTP requests, and basically everything that requires latency.
JavaScript has evolved from all these cluttered, unreadable, unmaintainable programming practices and that's what we're going to learn in this chapter.
Anyway, let's learn what an asynchronous program is. You can think of an asynchronous program as a program consisting of two lines of code, say L1 and L2. Now, we all know that in a given file, the code always executes from top to bottom. Also, it is intuitive such that the code will wait for each line to complete before executing the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access