/plushcap/analysis/ably/javascript-promises-and-async-await

The Ably async/await post we promised

What's this blog post about?

This article discusses how JavaScript executes asynchronous operations and reviews different ways to write asynchronous code from Callbacks to Promises, explaining what’s best and why. It also covers the modern and recommended way to write asynchronous JavaScript using Ably's JavaScript SDKs. The text delves into the inner workings of JavaScript, including its single-threaded nature and how it handles asynchronous functions with the help of Web APIs, Message Queue, and Event Loop. It then explores three ways to write asynchronous JavaScript: callbacks, Promises with .then syntax, and Promises with async/await syntax. The article also discusses concurrency of independent asynchronous statements and the case of asynchronous event listeners. Finally, it provides references and further reading for developers interested in learning more about realtime applications using Ably's SDKs.

Company
Ably

Date published
Dec. 8, 2021

Author(s)
Srushtika Neelakantam

Word count
3918

Language
English

Hacker News points
1


By Matt Makai. 2021-2024.