Web APIs & Async articles, tutorials, and guides

In-depth articles, tutorials, and guides on Web APIs & Async — covering everything from fundamentals to advanced patterns.

SharedArrayBuffer and Atomics: True Shared Memory in the Browser

Web APIs & Async

SharedArrayBuffer is the only browser primitive that allows multiple JavaScript contexts to read and write the same memory simultaneously. Combined with Atomics, it enables lock-free synchronization for high-performance parallel computation in the browser.

Web Workers vs Service Workers: Different Tools for Different Problems

Web APIs & Async

Web Workers and Service Workers both run JavaScript off the main thread, but they serve fundamentally different purposes. Understanding when to reach for each one — and when not to — is key to building performant, reliable web applications.

AbortController: Cancelling Fetch Requests and Async Operations

Web APIs & Async

Every fetch request you fire without a cancellation mechanism is a potential source of race conditions, memory leaks, and stale state. AbortController is the standard browser API that solves this — and it is simpler than most developers realise.

The JavaScript Event Loop: Macrotasks vs Microtasks

Web APIs & Async

JavaScript is single-threaded, yet it handles timers, network requests, and user input concurrently without freezing. The event loop is the mechanism that makes this possible — and understanding macrotasks vs microtasks explains the execution order that trips up almost every developer at some point.