
JavaScript Event loop: microtasks and macrotasks
Browser JavaScript execution flow, as well as in Node.js, is based on an event loop. Understanding how event loop works is important for optimizations, and sometimes […]
Browser JavaScript execution flow, as well as in Node.js, is based on an event loop. Understanding how event loop works is important for optimizations, and sometimes […]
Promise handlers .then/.catch/.finally are always asynchronous. Even when a Promise is immediately resolved, the code on the lines below .then/.catch/.finally will still execute before these handlers. Here’s a demo: If […]