JavaScript
Guides in JavaScript. Written like documentation — short paragraphs, real examples, interview-relevant depth.
Hoisting in JavaScript
beginnerWhat 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
intermediateHow JS runtimes schedule work — call stack, macrotasks, microtasks, rendering, and how to talk about it in interviews.
intermediate
var vs let vs const
beginnerScope, hoisting, TDZ, and reassignment — why const/let replaced var and how temporal dead zone shows up in bugs.
beginner
Closures
intermediateA function plus its lexical environment — scope chains, factories, privacy patterns, loop gotchas, and memory.
intermediate
Temporal Dead Zone
intermediateWhy let and const throw if you touch them early — binding creation vs initialization, TDZ edges with defaults, typeof, and closures.
intermediate
Promises
intermediateSettlement, chaining, errors, Promise API helpers, and how promises plug into the microtask queue — without cargo-cult async.
intermediate
call, apply, and bind
intermediateExplicit this control — call vs apply vs bind, partial application, bound constructors, and when arrows make bind pointless.
intermediate
Arrow Functions Deep Dive
beginnerLexical this, no arguments object, no construct, concise bodies — when arrows help and when methods and generators need classic functions.
beginner
Prototypal Inheritance
intermediateHow 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
intermediateBuild objects with Object.create, walk [[Prototype]], distinguish own vs inherited props, and know null-prototype maps.
intermediate
Classes in JavaScript
beginnerJS classes as sugar over prototypes — constructors, extends, super, fields, and what still differs from classical OOP.
beginner
Private Class Fields
intermediateHard privacy with #fields and #methods — syntax rules, brand checks, vs WeakMap closures, and what stays enumerable.
intermediate
Getters and Setters
beginnerget/set accessors on objects and classes — computed properties, validation, infinite loop traps, and defineProperty.
beginner
Symbols in JavaScript
intermediateUnique property keys with Symbol — privacy lite, well-known symbols (iterator, toStringTag), Symbol.for, and enumeration rules.
intermediate
Iterators and the Iterable Protocol
intermediateSymbol.iterator, next(), and for...of — how iterables work, custom iterators, and the difference from arrays.
intermediate
Generators
advancedfunction* and yield — lazy sequences, custom iterators, two-way next(value), and how generators power async patterns.
advanced
Destructuring Objects and Arrays
beginnerObject and array destructuring — renames, defaults, nested patterns, rest, and parameter destructuring in real APIs.
beginner
Rest and Spread Syntax
beginnerCollect args with rest, expand iterables with spread — shallow copy pitfalls, parameter order, and object merge patterns.
beginner
Default Parameters
beginnerES6 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
beginnerBacktick strings, interpolation, multiline, raw strings, and tagged templates for DSLs — without inventing XSS.
beginner
Optional Chaining
beginnerSafe property/call access with ?. — short-circuit rules, arrays, nullish defaults, and mistakes that hide real bugs.
beginner
Nullish Coalescing
beginnerUse ?? 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
beginnerMap 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
advancedHold object keys without preventing GC — private data, DOM metadata, and why WeakMap isn’t iterable.
advanced
Structured Clone
intermediateDeep-clone supported types with structuredClone — what transfers, what throws, vs JSON tricks and MessageChannel history.
intermediate
JSON parse and stringify pitfalls
beginnerJSON.stringify/parse footguns — undefined, dates, NaN, cycles, toJSON, revivers, and safe parsing of untrusted input.
beginner
Deep vs Shallow Copy
beginnerShallow copy shares nested refs; deep copy clones the graph — spread, structuredClone, JSON limits, and React state implications.
beginner
Immutability Patterns in JS
intermediateUpdate state without mutating — spread paths, arrays, structural sharing ideas, freeze, and libraries when nested updates hurt.
intermediate
Array map, filter, reduce
beginnermap, 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
beginnerShort-circuiting array predicates: find, findIndex, some, every, and includes — when to use each and common interview traps.
beginner
Sorting Arrays Correctly
beginnerArray.sort mutates, default string order breaks numbers — stable sort, compare functions, localeCompare, and immutable patterns.
beginner
Typed Arrays and ArrayBuffer
advancedBinary data in JS: ArrayBuffer, views (Uint8Array, DataView), endianness, slices vs subarray, and worker transfer.
advanced
ES Modules
beginnerimport/export semantics — live bindings, default vs named, strict mode, module graph loading, and script type=module.
beginner
Dynamic import()
intermediateimport() returns a module namespace promise — code splitting, conditional loads, and error handling for lazy routes.
intermediate
Strict Mode
beginnerWhat 'use strict' changes — silent errors become throws, this is undefined, and how modules enable strict by default.
beginner
Error Types and Custom Errors
beginnerError, TypeError, RangeError, and custom subclasses — name, cause, stack, and catching by type without swallowing bugs.
beginner
try catch finally Best Practices
beginnerCatch only what you handle, use finally for cleanup, avoid empty swallows, and bridge sync try/catch with async/await.
beginner
Throttle Implementation
intermediateImplement throttle in JavaScript — leading vs trailing edges, cancel, comparison with debounce, React cleanup, and interview-ready code.
intermediate
Event Emitter Pattern
intermediateImplement on/off/emit with Map of Sets — once, error isolation, memory leaks, and how this differs from DOM events.
intermediate
Pub Sub vs Observer
intermediateSeparate publishers from subscribers vs subject–observer coupling — when each fits UI apps, and a tiny EventEmitter sketch.
intermediate
Memoization
intermediateCache 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
intermediateCurry vs partial application — unary chains, bind, practical helpers, and when extra abstraction hurts readability.
intermediate
Compose and Pipe
intermediateRight-to-left compose vs left-to-right pipe — building unary pipelines, debugging intermediate values, and when a plain function is enough.
intermediate
Pure Functions
beginnerSame 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
beginnerIdentify 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 ===
beginnerObject.is vs === for NaN and ±0 — SameValue vs Strict Equality, and when each shows up in real checks.
beginner
Type Coercion Rules
intermediatePredict JS coercion: ToPrimitive, == abstract equality, + vs concat, truthiness, and how to avoid the worst comparisons.
intermediate
Truthy and Falsy Values
beginnerMemorize JS falsy list, avoid || default traps with 0 and '', and prefer Boolean() / ?? for intent-clear checks.
beginner
null vs undefined
beginnerWhen JS uses undefined vs null, equality traps, defaults, JSON gaps, and how to choose one intentionally in APIs.
beginner
Number Precision and IEEE 754
intermediateWhy 0.1 + 0.2 !== 0.3, safe integers, rounding strategies, and when to use integers, BigInt, or decimal libraries.
intermediate
BigInt Basics
intermediateBigInt for integers beyond Number.MAX_SAFE_INTEGER — literals, ops, JSON gaps, and when Number is still the right tool.
intermediate
Intl API Formatting
intermediateFormat numbers, dates, lists, and relative time with Intl — locales, options, and why you should stop hand-rolling currency strings.
intermediate
Date and Time Pitfalls
intermediateJS Date gotchas: parsing strings, time zones, month indexes, and when to reach for Temporal or a library.
intermediate
Regular Expressions Essentials
intermediateBuild and debug JS regex: literals vs constructor, flags, groups, lastIndex traps, and safe validation patterns for forms.
intermediate
String Methods Worth Knowing
beginnerPractical string APIs for UI work: slice vs substring, includes/startsWith, replaceAll, trim, pad, split, and unicode awareness.
beginner
URL and URLSearchParams
beginnerParse and build URLs safely with the URL API — search params, base resolution, encoding, and common SPA routing helpers.
beginner
Fetch API Fundamentals
beginnerHow fetch really works — Response.ok, one-shot bodies, JSON errors, AbortController, credentials, and production footguns.
beginner
AbortController
intermediateCancel fetch and other async work with AbortController and AbortSignal — timeouts, race conditions, and cleanup when components unmount.
intermediate
FormData and File Uploads
intermediateBuild multipart uploads with FormData, append files, inspect entries, and pair with fetch — progress and size limits included.
intermediate
Blob, File, and Object URLs
intermediateBlobs, File objects, object URLs, and revokeObjectURL — previews, downloads, and memory leaks from forgotten URLs.
intermediate
localStorage and sessionStorage
beginnerWeb Storage APIs — persistence, quota, JSON serialization, privacy modes, and when cookies or IndexedDB fit better.
beginner
IndexedDB Overview
advancedBrowser IndexedDB for structured client storage — databases, object stores, transactions, indexes, and when not to use it.
advanced
Cookies for Frontend Engineers
intermediatedocument.cookie, HttpOnly, Secure, SameSite, and when cookies beat localStorage for auth — practical rules without backend myths.
intermediate
History API for SPA Routing
intermediatepushState, replaceState, and popstate — client-side routing without reloads, scroll restoration, and server fallback gotchas.
intermediate
postMessage and Origin Checks
advancedCross-origin iframe and worker messaging with postMessage — targetOrigin, event.origin checks, and structured clone pitfalls.
advanced
Web Workers Overview
advancedMove CPU work off the main thread — dedicated workers, messaging, transferables, limits, and when workers aren’t worth it.
advanced
requestAnimationFrame
intermediateSchedule paint-aligned work with rAF — timestamps, cancelAnimationFrame, batching reads/writes, and vs setTimeout for animation.
intermediate
requestIdleCallback
advancedRun low-priority work in idle periods — deadline.timeRemaining, timeout option, polyfill with rAF, and what not to put idle.
advanced
MutationObserver
advancedWatch DOM mutations without polling — observe options, batching, microtask delivery, and safe patterns for widgets and analytics.
advanced
IntersectionObserver
intermediateObserve element visibility asynchronously — lazy images, infinite scroll, ad viewability, without scroll listener jank.
intermediate
ResizeObserver
intermediateObserve element size changes without window.resize — box options, loop limits, disconnect, and chart/layout patterns.
intermediate
Custom Events
intermediateCustomEvent, detail payloads, bubbles and composed — decoupling components without a global event bus mess.
intermediate
Capture, Bubble, once, and passive
intermediateEvent propagation phases, addEventListener options — capture, once, passive, and signal — and when each fixes a real bug.
intermediate
preventDefault vs stopPropagation
beginnerCancel browser defaults vs stop event bubbling — capture, stopImmediatePropagation, and when passive listeners ignore preventDefault.
beginner
DOM Traversal with querySelector
beginnerquerySelector, querySelectorAll, closest, and matches — CSS selectors in JS, NodeList vs HTMLCollection, and scoping roots.
beginner
Creating and Updating DOM Nodes
beginnercreateElement, textContent vs innerHTML, insert APIs, and batching updates — safe DOM writes without accidental XSS.
beginner
DocumentFragment
intermediateBuild subtrees off-DOM with DocumentFragment — one insert, fewer reflows, and how it differs from a wrapper div.
intermediate
classList and dataset
beginnerToggle CSS classes with classList and read data-* attributes via dataset — tokens, naming, and DOM performance notes.
beginner
client, offset, and scroll Dimensions
advancedclientWidth vs offsetWidth vs scrollWidth — borders, scrollbars, and which box measurement to use for layout math.
advanced
getBoundingClientRect
intermediateViewport-relative boxes with getBoundingClientRect — subpixels, scroll, transforms, and layout thrashing pitfalls.
intermediate
Selection and Range APIs
advancedRead and manipulate user selections with Selection and Range — caret position, surroundContents, and editor footguns.
advanced
contentEditable Pitfalls
advancedWhy contentEditable is hard: browser HTML mess, carets, sanitization, undo, and when to pick a real editor framework.
advanced
Shadow DOM Basics
advancedEncapsulate markup and styles with shadow roots — open vs closed, slots, CSS boundaries, and events retargeting.
advanced
Custom Elements
advancedWeb Components custom elements — define, connectedCallback, attributes vs properties, and autonomous vs customized built-ins.
advanced
template and slot
intermediateHTML template elements for inert DOM clones, slot projection in shadow DOM, and when to prefer templates over innerHTML strings.
intermediate
Resource Hints preload prefetch
intermediatedns-prefetch, preconnect, preload, prefetch, modulepreload — when each helps LCP/navigation and how to avoid over-fetching.
intermediate
Feature Detection vs UA Sniffing
beginnerPrefer feature detection over user-agent parsing — @supports, 'in' checks, and when UA hints still appear in the wild.
beginner
Polyfills and Baseline Targets
intermediateShip modern JS safely: polyfill vs transpile, core-js, browserslist, Baseline, and how to avoid shipping dead code to everyone.
intermediate
Memory Leaks in SPAs
advancedFind 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
advancedReachability, mark-and-sweep, retained closures and DOM — a practical GC model for frontend engineers debugging memory.
advanced
Shallow vs Deep Equality
intermediateCompare references vs structure — React prop checks, writing shallowEqual, deep equal costs, and JSON.stringify traps.
intermediate
queueMicrotask vs setTimeout
intermediateMicrotask vs macrotask scheduling — queueMicrotask, Promise.then, setTimeout(0), and why microtasks can starve rendering.
intermediate
Promise Combinators Practice
intermediateDrill Promise.all, allSettled, race, and any with real patterns — timeouts, fail-soft loads, and first-success fallbacks.
intermediate
Async Iteration and for await...of
advancedAsync iterables, for await...of, and streaming data — how async iterators differ from Promise.all and when to use each.
advanced
Top-level await
intermediateAwait at module top level — parent modules wait, graphs block carefully, and when to prefer async functions instead.
intermediate
Proxy and Reflect
advancedIntercept object operations with Proxy traps, forward correctly via Reflect, and know performance and invariant limits.
advanced
FinalizationRegistry
advancedFinalizationRegistry and WeakRef — non-deterministic cleanup hooks, what never to put in a finalizer, and rare valid use cases.
advanced
Bitwise Operators for Flags
advancedUsing & | ^ ~ << for permission flags and packed options — int32 traps, readability tradeoffs, and clearer alternatives.
advanced
Tagged Template Sanitization Idea
advancedUse 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
intermediateIIFE, Revealing Module, AMD, CommonJS, UMD — how pre-ESM isolation worked and what still shows up in legacy bundles.
intermediate
Functional Array Patterns
beginnerPractical functional array techniques — flatMap, partitioning, indexing, zip, and when chaining hurts performance.
beginner
Optional catch binding
beginnerOmit unused catch bindings with catch { } — when to ignore errors, when to log, and lint rules that keep this honest.
beginner
Numeric Separators
beginnerUse underscore separators in numeric literals for readability — rules, bases, BigInt, and what they do not change at runtime.
beginner
globalThis
beginnerglobalThis as the standard global object across browsers, workers, and Node — replacing window/self/global checks.
beginner
this Binding Rules
intermediateHow JavaScript decides this — default, method, explicit call/apply/bind, new, and lexical this in arrows. With runnable examples.
intermediate
Event Delegation
intermediateHandle many elements with one listener on a parent — bubbling, currentTarget vs target, and when not to delegate.
intermediate
Debounce Implementation
intermediateImplement debounce in JavaScript — trailing vs leading, cancel/flush, TypeScript typing, and when to throttle instead.
intermediate