< Back to notes

Browse 7 notes tagged JavaScript.

#JavaScript

JavaScript Closures: How Functions Remember Outer Variables

Use counters to explore closures and lexical scope, shared and independent state, and memory cleanup.

JavaScript Callbacks and Higher-Order Functions: Passing Behavior as an Argument

Build a reusable array transformation to understand callbacks, higher-order functions, map, arrow functions, mutation, and shallow copies.

What Happens When a JavaScript Function Runs? Execution Context and Local Memory

Trace JavaScript function calls, parameters, return values, and local variables with original examples, then see how closures preserve state.

ResizeObserver basics: element sizes, boxes, and update boundaries

An element can shrink without the viewport changing. Use a runnable JavaScript example to understand ResizeObserver, content and border boxes, logical axes, hidden elements, cleanup, and resize feedback loops.

IntersectionObserver: visibility, loading, and virtualization are separate jobs

Learn root, rootMargin, threshold, initial notifications, and observer cleanup with small JavaScript examples. Separate infinite-scroll request control from virtualization and its DOM budget.

AbortController: Cancel Stale Work, Not Every Error

AbortController stops work a person has superseded, but cancellation, timeouts, HTTP failures, and server-side effects need different handling. Put controller ownership in the right place first.

Browser Scheduler: Classify Work Before You Queue It

Scheduler gives the browser a priority hint; it is not a background thread. Keep short UI work synchronous, then choose postTask, yield, or a Web Worker from measured evidence.