Packed vs Holey Arrays in V8: Why new Array(n) Makes Spread 4x Slower
V8 labels every array by what it holds and whether it may have gaps. Labels only get more general, and holey arrays take slower paths.

V8 labels every array by what it holds and whether it may have gaps. Labels only get more general, and holey arrays take slower paths.

'this' in JavaScript depends on how a function is called, not where it's written. Four rules and one arrow-function exception cover every case.

A JavaScript class is a function with stricter rules. Learn the three rules it adds and why this.constructor lets an object reach its own class.

How V8's generational garbage collector works: scavenges cost per survivor, short-lived objects are nearly free, and pretenuring makes long-lived ones cheap.

How memory locality and CPU cache misses affect JavaScript: why array order changes loop speed for large arrays of objects, and when typed arrays help.

Why slice() in V8 can keep a huge parent string alive, how sliced strings cause memory leaks in Node.js, and how to copy a string to release it.

How V8 hidden classes and inline caches work, why property reads get slower past four object shapes, and how to keep hot code monomorphic.

What layout thrashing and forced reflow are, why reading offsetWidth after a style change is slow, and how batching reads and writes fixes it.

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.

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.

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.

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.

Why JavaScript's sort() compares numbers as strings, why a 'lazy' comparator works in Safari but breaks in Chrome, and the one-line fix.
Two patterns for taming fast events: debounce waits for silence, throttle limits how often. With examples, code, and interview answers.
`||` treats 0 and '' as missing. `??` only treats null/undefined as missing. Know the difference before it bites you in an interview or in prod.
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.
What queueMicrotask does, how it differs from Promise.then, and how microtasks really work under the hood.
Async/await feels like parallel code, but it isn’t. Here’s why JavaScript is still single-threaded and how async really works.
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.
All four start your promises at once. The only difference is when each one stops waiting, and what counts as failure. Pick by that rule.
How Web Workers work, why they matter, and when to use them to achieve real parallelism in frontend apps.
How to communicate between browser tabs, windows, or iframes easily using the BroadcastChannel API.
Understand the difference between shallow and deep copies, with examples and pitfalls.
Everything you need to cancel async work in JS: fetch, streams, custom tasks, React patterns, Node notes, timeouts, races, and common pitfalls.
What closures are, how they work (lexical scope), and how to use them without pitfalls.
A simple but deep dive into how Promises work in JavaScript and why they matter.
Understand what it means when people say JS is single-threaded.
A polished, practical event bus pattern with minimal JS, a strongly-typed TS version, wildcards, once-handlers, and React usage tips.
Event loop explained with a clean SVG timeline showing the actual execution order: Start → End → Promise → Timeout.
Understand microtasks and macrotasks across browsers and Node.js, including process.nextTick, setImmediate, and event loop phases.
Understand the difference between synchronous and asynchronous code in JavaScript with simple examples and analogies.
Understand how events travel through the DOM: bubbling (bottom-up) vs capturing (top-down) with simple examples and mental models.