ESC

Type to search the knowledge base.

JavaScript

Guides in JavaScript. Written like documentation — short paragraphs, real examples, interview-relevant depth.

Hoisting in JavaScript

beginner

What the engine does before your code runs — var vs function vs let/const, the TDZ, and the bugs that look like magic until you name the phase.

beginner

The Event Loop

intermediate

How JS runtimes schedule work — call stack, macrotasks, microtasks, rendering, and how to talk about it in interviews.

intermediate

var vs let vs const

beginner

Scope, hoisting, TDZ, and reassignment — why const/let replaced var and how temporal dead zone shows up in bugs.

beginner

Closures

intermediate

A function plus its lexical environment — scope chains, factories, privacy patterns, loop gotchas, and memory.

intermediate

Temporal Dead Zone

intermediate

Why let and const throw if you touch them early — binding creation vs initialization, TDZ edges with defaults, typeof, and closures.

intermediate

Promises

intermediate

Settlement, chaining, errors, Promise API helpers, and how promises plug into the microtask queue — without cargo-cult async.

intermediate

call, apply, and bind

intermediate

Explicit this control — call vs apply vs bind, partial application, bound constructors, and when arrows make bind pointless.

intermediate

Arrow Functions Deep Dive

beginner

Lexical this, no arguments object, no construct, concise bodies — when arrows help and when methods and generators need classic functions.

beginner

Prototypal Inheritance

intermediate

How JS objects delegate via [[Prototype]] — chains, Object.create, constructors, classes as sugar, own vs inherited props, and common footguns.

intermediate

Object.create and the prototype chain

intermediate

Build objects with Object.create, walk [[Prototype]], distinguish own vs inherited props, and know null-prototype maps.

intermediate

Classes in JavaScript

beginner

JS classes as sugar over prototypes — constructors, extends, super, fields, and what still differs from classical OOP.

beginner

Private Class Fields

intermediate

Hard privacy with #fields and #methods — syntax rules, brand checks, vs WeakMap closures, and what stays enumerable.

intermediate

Getters and Setters

beginner

get/set accessors on objects and classes — computed properties, validation, infinite loop traps, and defineProperty.

beginner

Symbols in JavaScript

intermediate

Unique property keys with Symbol — privacy lite, well-known symbols (iterator, toStringTag), Symbol.for, and enumeration rules.

intermediate

Iterators and the Iterable Protocol

intermediate

Symbol.iterator, next(), and for...of — how iterables work, custom iterators, and the difference from arrays.

intermediate

Generators

advanced

function* and yield — lazy sequences, custom iterators, two-way next(value), and how generators power async patterns.

advanced

Destructuring Objects and Arrays

beginner

Object and array destructuring — renames, defaults, nested patterns, rest, and parameter destructuring in real APIs.

beginner

Rest and Spread Syntax

beginner

Collect args with rest, expand iterables with spread — shallow copy pitfalls, parameter order, and object merge patterns.

beginner

Default Parameters

beginner

ES6 default parameter values — evaluated at call time, temporal dead zone with lets, and why undefined triggers defaults but null does not.

beginner

Template Literals and Tagged Templates

beginner

Backtick strings, interpolation, multiline, raw strings, and tagged templates for DSLs — without inventing XSS.

beginner

Optional Chaining

beginner

Safe property/call access with ?. — short-circuit rules, arrays, nullish defaults, and mistakes that hide real bugs.

beginner

Nullish Coalescing

beginner

Use ?? for null/undefined defaults without treating 0 or empty string as missing — vs ||, ??= and optional chaining.

beginner

Logical Assignment Operators

intermediate

||=, &&=, and ??= — assign only when nullish or falsy/truthy, with short-circuiting and practical defaults patterns.

intermediate

Map and Set

beginner

Map for any-key dictionaries and Set for unique values — iteration order, object keys, Weak variants, and when objects/arrays still win.

beginner

WeakMap and WeakSet

advanced

Hold object keys without preventing GC — private data, DOM metadata, and why WeakMap isn’t iterable.

advanced

Structured Clone

intermediate

Deep-clone supported types with structuredClone — what transfers, what throws, vs JSON tricks and MessageChannel history.

intermediate

JSON parse and stringify pitfalls

beginner

JSON.stringify/parse footguns — undefined, dates, NaN, cycles, toJSON, revivers, and safe parsing of untrusted input.

beginner

Deep vs Shallow Copy

beginner

Shallow copy shares nested refs; deep copy clones the graph — spread, structuredClone, JSON limits, and React state implications.

beginner

Immutability Patterns in JS

intermediate

Update state without mutating — spread paths, arrays, structural sharing ideas, freeze, and libraries when nested updates hurt.

intermediate

Array map, filter, reduce

beginner

map, filter, and reduce as the core transform toolkit — immutability, chaining costs, reduce patterns, and when a plain loop is clearer.

beginner

Array find, some, every, includes

beginner

Short-circuiting array predicates: find, findIndex, some, every, and includes — when to use each and common interview traps.

beginner

Sorting Arrays Correctly

beginner

Array.sort mutates, default string order breaks numbers — stable sort, compare functions, localeCompare, and immutable patterns.

beginner

Typed Arrays and ArrayBuffer

advanced

Binary data in JS: ArrayBuffer, views (Uint8Array, DataView), endianness, slices vs subarray, and worker transfer.

advanced

ES Modules

beginner

import/export semantics — live bindings, default vs named, strict mode, module graph loading, and script type=module.

beginner

Dynamic import()

intermediate

import() returns a module namespace promise — code splitting, conditional loads, and error handling for lazy routes.

intermediate

Strict Mode

beginner

What 'use strict' changes — silent errors become throws, this is undefined, and how modules enable strict by default.

beginner

Error Types and Custom Errors

beginner

Error, TypeError, RangeError, and custom subclasses — name, cause, stack, and catching by type without swallowing bugs.

beginner

try catch finally Best Practices

beginner

Catch only what you handle, use finally for cleanup, avoid empty swallows, and bridge sync try/catch with async/await.

beginner

Throttle Implementation

intermediate

Implement throttle in JavaScript — leading vs trailing edges, cancel, comparison with debounce, React cleanup, and interview-ready code.

intermediate

Event Emitter Pattern

intermediate

Implement on/off/emit with Map of Sets — once, error isolation, memory leaks, and how this differs from DOM events.

intermediate

Pub Sub vs Observer

intermediate

Separate publishers from subscribers vs subject–observer coupling — when each fits UI apps, and a tiny EventEmitter sketch.

intermediate

Memoization

intermediate

Cache pure function results by argument key — implement memo, handle cache size, and know when React.memo is a different tool.

intermediate

Currying and Partial Application

intermediate

Curry vs partial application — unary chains, bind, practical helpers, and when extra abstraction hurts readability.

intermediate

Compose and Pipe

intermediate

Right-to-left compose vs left-to-right pipe — building unary pipelines, debugging intermediate values, and when a plain function is enough.

intermediate

Pure Functions

beginner

Same inputs → same output, no side effects — why purity helps tests and UI, and how to isolate effects at the edges.

beginner

Side Effects in Frontend Code

beginner

Identify I/O and mutations outside return values — where effects belong in UI apps, React rules, and how to test around them.

beginner

Object.is vs ===

beginner

Object.is vs === for NaN and ±0 — SameValue vs Strict Equality, and when each shows up in real checks.

beginner

Type Coercion Rules

intermediate

Predict JS coercion: ToPrimitive, == abstract equality, + vs concat, truthiness, and how to avoid the worst comparisons.

intermediate

Truthy and Falsy Values

beginner

Memorize JS falsy list, avoid || default traps with 0 and '', and prefer Boolean() / ?? for intent-clear checks.

beginner

null vs undefined

beginner

When JS uses undefined vs null, equality traps, defaults, JSON gaps, and how to choose one intentionally in APIs.

beginner

Number Precision and IEEE 754

intermediate

Why 0.1 + 0.2 !== 0.3, safe integers, rounding strategies, and when to use integers, BigInt, or decimal libraries.

intermediate

BigInt Basics

intermediate

BigInt for integers beyond Number.MAX_SAFE_INTEGER — literals, ops, JSON gaps, and when Number is still the right tool.

intermediate

Intl API Formatting

intermediate

Format numbers, dates, lists, and relative time with Intl — locales, options, and why you should stop hand-rolling currency strings.

intermediate

Date and Time Pitfalls

intermediate

JS Date gotchas: parsing strings, time zones, month indexes, and when to reach for Temporal or a library.

intermediate

Regular Expressions Essentials

intermediate

Build and debug JS regex: literals vs constructor, flags, groups, lastIndex traps, and safe validation patterns for forms.

intermediate

String Methods Worth Knowing

beginner

Practical string APIs for UI work: slice vs substring, includes/startsWith, replaceAll, trim, pad, split, and unicode awareness.

beginner

URL and URLSearchParams

beginner

Parse and build URLs safely with the URL API — search params, base resolution, encoding, and common SPA routing helpers.

beginner

Fetch API Fundamentals

beginner

How fetch really works — Response.ok, one-shot bodies, JSON errors, AbortController, credentials, and production footguns.

beginner

AbortController

intermediate

Cancel fetch and other async work with AbortController and AbortSignal — timeouts, race conditions, and cleanup when components unmount.

intermediate

FormData and File Uploads

intermediate

Build multipart uploads with FormData, append files, inspect entries, and pair with fetch — progress and size limits included.

intermediate

Blob, File, and Object URLs

intermediate

Blobs, File objects, object URLs, and revokeObjectURL — previews, downloads, and memory leaks from forgotten URLs.

intermediate

localStorage and sessionStorage

beginner

Web Storage APIs — persistence, quota, JSON serialization, privacy modes, and when cookies or IndexedDB fit better.

beginner

IndexedDB Overview

advanced

Browser IndexedDB for structured client storage — databases, object stores, transactions, indexes, and when not to use it.

advanced

Cookies for Frontend Engineers

intermediate

document.cookie, HttpOnly, Secure, SameSite, and when cookies beat localStorage for auth — practical rules without backend myths.

intermediate

History API for SPA Routing

intermediate

pushState, replaceState, and popstate — client-side routing without reloads, scroll restoration, and server fallback gotchas.

intermediate

postMessage and Origin Checks

advanced

Cross-origin iframe and worker messaging with postMessage — targetOrigin, event.origin checks, and structured clone pitfalls.

advanced

Web Workers Overview

advanced

Move CPU work off the main thread — dedicated workers, messaging, transferables, limits, and when workers aren’t worth it.

advanced

requestAnimationFrame

intermediate

Schedule paint-aligned work with rAF — timestamps, cancelAnimationFrame, batching reads/writes, and vs setTimeout for animation.

intermediate

requestIdleCallback

advanced

Run low-priority work in idle periods — deadline.timeRemaining, timeout option, polyfill with rAF, and what not to put idle.

advanced

MutationObserver

advanced

Watch DOM mutations without polling — observe options, batching, microtask delivery, and safe patterns for widgets and analytics.

advanced

IntersectionObserver

intermediate

Observe element visibility asynchronously — lazy images, infinite scroll, ad viewability, without scroll listener jank.

intermediate

ResizeObserver

intermediate

Observe element size changes without window.resize — box options, loop limits, disconnect, and chart/layout patterns.

intermediate

Custom Events

intermediate

CustomEvent, detail payloads, bubbles and composed — decoupling components without a global event bus mess.

intermediate

Capture, Bubble, once, and passive

intermediate

Event propagation phases, addEventListener options — capture, once, passive, and signal — and when each fixes a real bug.

intermediate

preventDefault vs stopPropagation

beginner

Cancel browser defaults vs stop event bubbling — capture, stopImmediatePropagation, and when passive listeners ignore preventDefault.

beginner

DOM Traversal with querySelector

beginner

querySelector, querySelectorAll, closest, and matches — CSS selectors in JS, NodeList vs HTMLCollection, and scoping roots.

beginner

Creating and Updating DOM Nodes

beginner

createElement, textContent vs innerHTML, insert APIs, and batching updates — safe DOM writes without accidental XSS.

beginner

DocumentFragment

intermediate

Build subtrees off-DOM with DocumentFragment — one insert, fewer reflows, and how it differs from a wrapper div.

intermediate

classList and dataset

beginner

Toggle CSS classes with classList and read data-* attributes via dataset — tokens, naming, and DOM performance notes.

beginner

client, offset, and scroll Dimensions

advanced

clientWidth vs offsetWidth vs scrollWidth — borders, scrollbars, and which box measurement to use for layout math.

advanced

getBoundingClientRect

intermediate

Viewport-relative boxes with getBoundingClientRect — subpixels, scroll, transforms, and layout thrashing pitfalls.

intermediate

Selection and Range APIs

advanced

Read and manipulate user selections with Selection and Range — caret position, surroundContents, and editor footguns.

advanced

contentEditable Pitfalls

advanced

Why contentEditable is hard: browser HTML mess, carets, sanitization, undo, and when to pick a real editor framework.

advanced

Shadow DOM Basics

advanced

Encapsulate markup and styles with shadow roots — open vs closed, slots, CSS boundaries, and events retargeting.

advanced

Custom Elements

advanced

Web Components custom elements — define, connectedCallback, attributes vs properties, and autonomous vs customized built-ins.

advanced

template and slot

intermediate

HTML template elements for inert DOM clones, slot projection in shadow DOM, and when to prefer templates over innerHTML strings.

intermediate

Resource Hints preload prefetch

intermediate

dns-prefetch, preconnect, preload, prefetch, modulepreload — when each helps LCP/navigation and how to avoid over-fetching.

intermediate

Feature Detection vs UA Sniffing

beginner

Prefer feature detection over user-agent parsing — @supports, 'in' checks, and when UA hints still appear in the wild.

beginner

Polyfills and Baseline Targets

intermediate

Ship modern JS safely: polyfill vs transpile, core-js, browserslist, Baseline, and how to avoid shipping dead code to everyone.

intermediate

Memory Leaks in SPAs

advanced

Find and fix SPA memory leaks: dangling listeners, uncleared timers, retained closures, detached DOM, and how to prove growth in DevTools.

advanced

Garbage Collection Mental Model

advanced

Reachability, mark-and-sweep, retained closures and DOM — a practical GC model for frontend engineers debugging memory.

advanced

Shallow vs Deep Equality

intermediate

Compare references vs structure — React prop checks, writing shallowEqual, deep equal costs, and JSON.stringify traps.

intermediate

queueMicrotask vs setTimeout

intermediate

Microtask vs macrotask scheduling — queueMicrotask, Promise.then, setTimeout(0), and why microtasks can starve rendering.

intermediate

Promise Combinators Practice

intermediate

Drill Promise.all, allSettled, race, and any with real patterns — timeouts, fail-soft loads, and first-success fallbacks.

intermediate

Async Iteration and for await...of

advanced

Async iterables, for await...of, and streaming data — how async iterators differ from Promise.all and when to use each.

advanced

Top-level await

intermediate

Await at module top level — parent modules wait, graphs block carefully, and when to prefer async functions instead.

intermediate

Proxy and Reflect

advanced

Intercept object operations with Proxy traps, forward correctly via Reflect, and know performance and invariant limits.

advanced

FinalizationRegistry

advanced

FinalizationRegistry and WeakRef — non-deterministic cleanup hooks, what never to put in a finalizer, and rare valid use cases.

advanced

Bitwise Operators for Flags

advanced

Using & | ^ ~ << for permission flags and packed options — int32 traps, readability tradeoffs, and clearer alternatives.

advanced

Tagged Template Sanitization Idea

advanced

Use tagged templates to auto-escape interpolated values for HTML — why it beats string concat, and limits vs real sanitizers.

advanced

Module Patterns before ES Modules

intermediate

IIFE, Revealing Module, AMD, CommonJS, UMD — how pre-ESM isolation worked and what still shows up in legacy bundles.

intermediate

Functional Array Patterns

beginner

Practical functional array techniques — flatMap, partitioning, indexing, zip, and when chaining hurts performance.

beginner

Optional catch binding

beginner

Omit unused catch bindings with catch { } — when to ignore errors, when to log, and lint rules that keep this honest.

beginner

Numeric Separators

beginner

Use underscore separators in numeric literals for readability — rules, bases, BigInt, and what they do not change at runtime.

beginner

globalThis

beginner

globalThis as the standard global object across browsers, workers, and Node — replacing window/self/global checks.

beginner

this Binding Rules

intermediate

How JavaScript decides this — default, method, explicit call/apply/bind, new, and lexical this in arrows. With runnable examples.

intermediate

Event Delegation

intermediate

Handle many elements with one listener on a parent — bubbling, currentTarget vs target, and when not to delegate.

intermediate

Debounce Implementation

intermediate

Implement debounce in JavaScript — trailing vs leading, cancel/flush, TypeScript typing, and when to throttle instead.

intermediate