BitlystBitlyst
PostsSeriesTopicsAbout

Bitlyst

Short, diagram-first posts on JavaScript, React & Next.js. Follow via RSS or the newsletter.

© 2026 Mohsen Fallahnejad

PostsSeriesTopicsLinksAboutRSSGitHubX
← All topics

#javascript

24 posts

The $4.35 Item That Was Charged $4.34

Why 0.1 + 0.2 !== 0.3 in JavaScript, how floating-point math drops a cent when converting dollars to cents, and why money should be stored as integers.

Nov 3, 20265 min read

The Leaderboard Arrived Sorted. JavaScript Re-sorted It by User ID.

Why JavaScript object key order puts integer-like keys first in ascending order, how that silently reorders JSON from your API, and when to use an array or Map.

Nov 3, 20265 min read

The Settings Object That Came Back undefined

How automatic semicolon insertion (ASI) turns `return` followed by a newline into `return;`, and the lines where JavaScript refuses to add a semicolon at all.

Nov 2, 20265 min read

You Selected Rows 3, 8, 12, 15 and 20. JavaScript Checked 3, 1 and 8.

Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3]: map passes the index as parseInt's radix. Plus the Number('') trap hiding in the obvious fix.

Nov 1, 20264 min read2

The Leaderboard That Ranked 9 Points Above 100

Why JavaScript's sort() compares numbers as strings, why a 'lazy' comparator works in Safari but breaks in Chrome, and the one-line fix.

Oct 31, 20265 min read3

Debounce vs Throttle — One Sentence to Remember Forever

Two patterns for taming fast events: debounce waits for silence, throttle limits how often. With examples, code, and interview answers.

Jul 8, 20264 min read

?? vs || — The Default-Value Trap That Breaks Real Apps

`||` treats 0 and '' as missing. `??` only treats null/undefined as missing. Know the difference before it bites you in an interview or in prod.

Jul 8, 20265 min read1

JavaScript Generators & Iterators — Lazy Sequences Explained

Generators let you produce values on demand instead of all at once. Learn how iterators and generator functions work, and when to reach for them.

Jun 29, 20263 min read

queueMicrotask Explained: The Smallest Async Queue in JavaScript

What queueMicrotask does, how it differs from Promise.then, and how microtasks really work under the hood.

Dec 31, 20251 min read1

Why async/await Doesn’t Make JavaScript Code Parallel

Async/await feels like parallel code, but it isn’t. Here’s why JavaScript is still single-threaded and how async really works.

Dec 30, 20253 min read1

How Promise.all Works in a Single-Threaded JavaScript World

If JavaScript is single-threaded, how can Promise.all handle multiple requests at the same time? A deep dive into the event loop and async I/O.

Dec 30, 20252 min read1

Promise APIs Compared: all vs race vs any vs allSettled

A practical and conceptual comparison of Promise.all, Promise.race, Promise.any, and Promise.allSettled.

Dec 30, 20253 min read2

Web Workers Explained for Frontend Developers

How Web Workers work, why they matter, and when to use them to achieve real parallelism in frontend apps.

Dec 30, 20253 min read2

BroadcastChannel API in JavaScript

How to communicate between browser tabs, windows, or iframes easily using the BroadcastChannel API.

Oct 5, 20253 min read1

Deep Copy vs Shallow Copy in JavaScript

Understand the difference between shallow and deep copies, with examples and pitfalls.

Sep 26, 20252 min read2

AbortController & AbortSignal

Everything you need to cancel async work in JS: fetch, streams, custom tasks, React patterns, Node notes, timeouts, races, and common pitfalls.

Sep 23, 20254 min read

JavaScript Closures — A Simple Deep Dive

What closures are, how they work (lexical scope), and how to use them without pitfalls.

Sep 23, 20255 min read

JavaScript Promises Explained

A simple but deep dive into how Promises work in JavaScript and why they matter.

Sep 23, 20252 min read

JavaScript is Single-Threaded

Understand what it means when people say JS is single-threaded.

Sep 23, 20252 min read

JavaScript Event Bus 🚍 (JS + TypeScript)

A polished, practical event bus pattern with minimal JS, a strongly-typed TS version, wildcards, once-handlers, and React usage tips.

Sep 21, 20254 min read1

JavaScript's Event Loop — Simple Guide (with SVG Timeline)

Event loop explained with a clean SVG timeline showing the actual execution order: Start → End → Promise → Timeout.

Sep 20, 20251 min read

Microtask vs Macrotask in JavaScript — With Node.js vs Browser Notes

Understand microtasks and macrotasks across browsers and Node.js, including process.nextTick, setImmediate, and event loop phases.

Sep 20, 20253 min read

Event Bubbling vs Event Capturing in JavaScript

Understand how events travel through the DOM: bubbling (bottom-up) vs capturing (top-down) with simple examples and mental models.

Sep 13, 20251 min read

Async vs Sync in JavaScript

Understand the difference between synchronous and asynchronous code in JavaScript with simple examples and analogies.

Sep 13, 20251 min read

Related topics

#async#event loop#gotchas#interview#promises#arrays#basics#browser