Array.prototype.with Replaces One Index Safely
Replace a single element immutably with Array.prototype.with, supporting negative indices from the end while throwing RangeError on out-of-bounds updates.
Replace a single element immutably with Array.prototype.with, supporting negative indices from the end while throwing RangeError on out-of-bounds updates.
Register async teardown hooks with AsyncDisposableStack use, adopt, and defer, then transfer ownership with move so cleanup runs reliably in reverse.
Store signed 64-bit integers beyond MAX_SAFE_INTEGER in BigInt64Array without float rounding loss, and inspect raw bytes with DataView.getBigInt64.
Pass a helper function to V8 Error.captureStackTrace so custom validation errors trim internal helper frames and highlight the caller site first.
Format start-to-end date spans with Intl.DateTimeFormat.formatRange to collapse shared months or years, and inspect segment sources via formatRangeToParts.
Inspect the effective timeZone, calendar, numberingSystem, and hourCycle resolved by Intl.DateTimeFormat after applying locale extension tags.
Query runtime ICU regional defaults from Intl.Locale using getWeekInfo, getTextInfo, and getCalendars for week starts, weekends, and text direction.
Resolve the grammatical plural form of a numeric span with Intl.PluralRules.selectRange across locales instead of guessing from the upper bound alone.
Tokenize Latin and CJK text into linguistic words with Intl.Segmenter word granularity and filter out spaces and punctuation using the isWordLike flag.
Wrap plain next() iterator objects with ES2025 Iterator.from so filter, map, and take chain lazily and stop pulling items once take hits its limit.
Wrap iterables with Iterator.from and terminate lazy pipelines via drop, find, some, every, and reduce so infinite or large streams stop on first match.
Take roots with Math.sqrt and Math.cbrt: sqrt returns NaN for negatives, cbrt keeps the sign, and neither matches the precision promises of exact math.
Convert multi-byte wire buffers between big-endian and little-endian in place with Node Buffer.swap16 and swap32, catching unaligned buffer lengths.
Subscribe to node:diagnostics_channel tracingChannel lifecycle events around traceSync and tracePromise without coupling hooks to business logic.
Inspect registered callbacks across both Node EventEmitter and AbortSignal EventTarget objects via events.getEventListeners to verify cleanup.
Transform Node Readable streams lazily with built-in filter, map, take, and toArray helpers so consumers pull only the records they need.
Decode multi-byte UTF-8 payloads split mid-character across Node chunks with StringDecoder.write and flush incomplete tails via StringDecoder.end.
Remove ANSI SGR and VT control escapes with Node util.stripVTControlCharacters so log parsers, checksums, and alignment widths stay accurate.
Clone getters, setters, symbol keys, and non-enumerable flags faithfully with Object.getOwnPropertyDescriptors and Object.defineProperties instead of spread.
Issue temporary object handles with Proxy.revocable and call revoke() when a task ends so subsequent property reads, writes, and in checks throw TypeError.
Invoke functions with an explicit this receiver and argument array via Reflect.apply, avoiding collisions when objects shadow .apply or lack Function methods.
Forward the third receiver argument in Reflect.get inside Proxy traps so inherited getters resolve this through the proxy rather than the raw target.
Allocate an ArrayBuffer with maxByteLength and call resize() to expand or shrink backing bytes in place while length-tracking typed views update automatically.
Verify required scopes and mutual-exclusion rules cleanly with ES2025 Set.prototype.isSubsetOf, isSupersetOf, and isDisjointFrom without array copies.
Detect lone UTF-16 surrogates with String.prototype.isWellFormed before calling encodeURIComponent, using toWellFormed only when lossy repair fits.
Catch SuppressedError thrown when both an operation and DisposableStack cleanup fail, then inspect error and suppressed links across the full chain.
Implement Symbol.replace on a custom matcher object so String.prototype.replace runs literal token redaction without dynamic RegExp compilation.
Contrast Uint8ClampedArray saturating clamping to 0..255 with round-half-to-even against Uint8Array modulo-256 wraparound for pixel and signal channels.
Canonicalize query strings with URLSearchParams.prototype.sort, which orders keys by UTF-16 code units while keeping duplicate key values in relative order.
Search arrays from the right with lastIndexOf, whose fromIndex marks where the backward scan begins and silently clamps out-of-range starts instead of throwing.
Intl.Collator sensitivity climbs from base to variant: base folds case and accents, accent keeps accents, case keeps case, and variant distinguishes both.
Node.compareDocumentPosition returns a bitmask combining containment and document order, so one call answers contains, contained-by, before, and after.
Pull deep fields out in one statement with nested destructuring, rename bindings with colons, and combine defaults so missing API data cannot crash a render.
String.fromCodePoint accepts surrogate pairs and ZWJ sequences while length counts UTF-16 units, so one emoji can span two units or five across joins.
DateTimeFormat.formatToParts splits a formatted date into typed fields that reassemble into ISO stamps, and resolvedOptions reports the chosen locale rules.
concat spreads array-like values only when Symbol.isConcatSpreadable is true; flipping the flag keeps real arrays nested or flattens array-likes on demand.
Adding an abort listener after the signal already aborted does not throw and does not fire, so cleanup paths must check signal.aborted before subscribing.
Sort user-facing text with String.prototype.localeCompare or Intl.Collator, whose numeric and case-first options fix the classic 2-before-10 ordering bug.
Bound values with Math.min and Math.max — empty calls return the infinities, any NaN poisons the result, and nesting the two builds a clamp.
Classify and normalize numbers with Math.sign and Math.abs: sign preserves -0 as -0, abs collapses it to 0, and both propagate NaN untouched.
Parse numeric strings with parseFloat and parseInt, which tolerate trailing garbage where Number() rejects it — choose deliberately per input source.
A ReadableStream consumer calls reader.read() until done flips true, decoding each Uint8Array chunk with stream:true so multi-byte splits stay intact.
Read single UTF-16 code units with charAt and charCodeAt — out-of-range asks return the empty string and NaN instead of throwing, unlike bracket access.
Measure and index strings by UTF-16 code units: length and bracket access split astral emoji into surrogates, while spread iteration reads whole code points.
Duplicate strings with repeat for indentation and separator lines: zero returns the empty string, while negative or infinite counts raise RangeError.
Compute replacements at runtime with a function passed to replace, where the callback receives the match, capture groups, offset, and the full string.
split keeps trailing empties by default; the limit argument truncates and discards the remainder; matchAll preserves capture groups.
TextEncoder.encodeInto writes into an existing Uint8Array and reports both read and written counts, stopping at the buffer boundary instead of allocating.
focus() and blur() update document.activeElement immediately, blur falls back to body, and document.hasFocus() reports whether the page owns the keyboard.
every() returns true for an empty array because no item can contradict the rule; gate empty input explicitly instead of inheriting the vacuous default.
textContent concatenates every text node including style rules and hidden spans, while innerText approximates rendered output and drops what CSS hides.
The for attribute and label wrapping both connect a label to its control; element.labels stays live and htmlFor re-points the association on assignment.
Each request records a sequence ticket and responses check it before applying, so type-ahead searches drop stale results instead of flashing old data.
Plain function calls leave new.target undefined, so constructors can throw a clear error, and the same check lets base classes reject direct instantiation.
Object.entries pairs keys with values and Object.fromEntries rebuilds the record, so per-value transforms and key renames run without hand-written loops.
querySelectorAll(':scope > li') pins matching to direct children of the node, while a bare selector keeps matching descendants at every nesting depth.
Comparators returning booleans only produce 0 or 1, so descending swaps never apply; subtract the fields instead to get a numeric comparator.
Long-running loops cannot be interrupted from outside, so cooperative work calls signal.throwIfAborted() between steps to stop cleanly on abort.
typeof classifies null as object because of a legacy type tag, so branches that trust typeof must check value === null separately to catch unset values.
Split CPU-heavy work into chunks and await a setTimeout macrotask between them so timers and I/O run; await Promise.resolve() only drains microtasks.
click only fires for the primary button; auxclick handles middle and unclaimed secondary presses, which is where custom middle-click link behavior belongs.
await returns an array literal untouched, so its promise elements stay pending; Promise.all actually waits for every element and keeps the original order.
Buffer.from(value, "hex") silently stops at the first invalid character pair instead of throwing; untrusted hex must be shape-checked first.
FocusEvent.relatedTarget names the element about to receive focus, letting an open menu tell a genuine move inside the widget from a real focus-out to the page.
getModifierState('CapsLock') reports the physical lock state at keydown time, so password fields can surface a caps-lock hint without tracking keyup.
JSON.parse defines __proto__ as an ordinary own property, but assigning that key hits the setter and hijacks the target object, so merges must reject it.
Held keys re-fire keydown with event.repeat set to true, so guarding on repeat keeps one physical press equal to one action instead of dozens of toggles.
Map.forEach passes (value, key) in the opposite order of Object.entries, and JSON.stringify of a Map yields {}, so convert through Object.fromEntries first.
matchAll throws TypeError without the /g flag because a non-global regex would match forever; it iterates a clone, so the original lastIndex stays untouched.
navigator.connection exposes effectiveType, saveData and rtt on Chromium; feature-detect it, honor saveData first, then pick assets by measured network quality.
Object.assign skips null and undefined sources, overwrites keys layer by layer, and mutates only its first argument, so pass {} first to keep defaults intact.
wheel deltas arrive in pixels, lines, or pages depending on deltaMode; multiplying by a fixed unit per mode keeps custom scrolling consistent across devices.
Assert nested config subsets with assert.partialDeepStrictEqual: extra keys pass, a mismatched nested value throws AssertionError with ERR_ASSERTION.
Race several async generators through one merged iterator: each source keeps its own next() promise and Promise.any picks whichever settles first.
Wait on shared memory without freezing the event loop: waitAsync returns a promise while timers keep firing, unlike the blocking Atomics.wait.
A backreference like \1 recalls what the first group captured, so repeated words and echoed tokens match without naming them in advance.
Build shapes as Path2D objects and ask ctx.isPointInPath per pointer coordinate, returning every shape that contains the point.
Keep a select-all checkbox truthful: indeterminate marks partial selection while checked stays binary, and aria-checked mixed exposes the third state.
checkVisibility reports whether an element actually renders; display:none and detachment fail while visibility and opacity need explicit check options.
Mixin factories take a base class and return an extended one, stacking state and behavior along a controlled super chain instead of deep inheritance.
cloneNode(false) copies one node, cloneNode(true) copies the subtree; cloned ids get duplicated and listeners never travel with the copy.
Select a DOM span with document.createRange, preview it with cloneContents, and move whole node sets with extractContents plus append.
CSS.escape renders arbitrary ids and user-derived strings safe inside querySelector, where an unescaped colon or dot throws SyntaxError.
CSS.supports probes a single declaration with two arguments or a full @supports condition with one, driving progressive enhancement decisions.
Date.now is wall-clock whole milliseconds while performance.now is monotonic with sub-millisecond precision, so durations need the latter.
Give grouped details panels a shared name attribute: opening one closes the others automatically, an exclusive accordion with zero JavaScript.
Assign name=value pairs with max-age and path, then read the whole jar back as one string split on semicolons — encodeURIComponent keeps awkward values intact.
elementsFromPoint returns every element under a coordinate from topmost down, so drop targets and hit tests can see past overlays that elementFromPoint hides.
Record how late timer callbacks run with monitorEventLoopDelay: a synchronous burst blocks the loop and shows up as nanosecond-scale max delay.
setMaxListeners without targets raises or lowers the process-wide listener cap; overflows warn on stderr instead of throwing.
Recursively walk nested objects into dotted key paths and rebuild the tree with unflatten, with arrays kept as leaf values.
Float16Array stores 2-byte half-precision floats: exact for grid values, rounded to the nearest f16 step otherwise; 65520 and up overflow to Infinity.
Hook the formdata event to append computed fields onto the entry list right before submission, without adding invisible inputs to the markup.
appendFile creates the file when missing and appends after that, so log lines never rewrite the whole file — missing parents must be handled.
Read a file through one reused buffer with FileHandle.read: each call reports its byte count and a zero read marks end of file.
Create nested output folders in one call with recursive:true, repeat the call safely on existing paths, then drop the whole tree with rm recursive and force.
Stream directory entries one at a time with opendir's async iterator; the Dir auto-closes after a complete pass, so later reads throw ERR_DIR_CLOSED.
Pass an AbortSignal into fs/promises options so a caller that already timed out rejects the read immediately without touching the file.
List whole directory trees with readdir({ recursive: true, withFileTypes: true }) and get Dirent objects that carry parentPath for each entry.
Read volume-level numbers with fs.statfs: block size, total and free space, unprivileged availability, inode slots, and a used-percent calculation.