JavaScript
The language itself: syntax, runtime behaviour and the habits that keep it readable.
2026
- Keep meeting times across DST with TemporalUse Temporal.ZonedDateTime to move a meeting by one calendar day across daylight saving time, then convert it for an attendee.
- Add months with Temporal.PlainDateKeep the original billing date as the anchor for month-end renewals, then compare calendar dates with Temporal.PlainDate.
- Encode Uint8Array bytes as base64 or hexConvert Uint8Array bytes to base64, base64url or hex and decode them with the matching native methods.
- Match literal text with RegExp.escapeUse RegExp.escape when inserting literal search text into a larger regular expression that checks a filename suffix.
- Pack samples with Float16Array and Math.f16roundHalve a Float32Array backing buffer with Float16Array and check rounding, underflow, and overflow before converting your data.
- Lazy pipelines with Iterator helpersUse iterator helpers to collect the first two matching records from a generator without reading its remaining values or building intermediate arrays.
- Format durations with Intl.DurationFormatFormat elapsed time in the user’s locale by splitting a minute count into units and choosing a label or timer style.
- Auto-cleanup with using and Symbol.disposeUse using and Symbol.dispose to close a handle before releasing its lock, even when your function returns early or throws.
- Catch sync and async errors with Promise.tryWrap callbacks that may throw or return a promise and handle both failures with one catch handler.
- Append bytes to a resizable ArrayBufferAppend bytes to a resizable ArrayBuffer, keep its Uint8Array view live, and enforce the maximum size before growing the buffer.
- Set union, intersection and difference built inCompare two subscriber lists with Set union, intersection and difference, and choose an explicit order when you display the result.
- Truncate visible characters with Intl.SegmenterUse Intl.Segmenter to shorten JavaScript strings at grapheme boundaries so accents and joined emoji stay intact.
- Combine fetch cancellation with AbortSignal.anyGive fetch a Cancel button and a timeout with AbortSignal.any, then distinguish a user cancellation from an expired deadline.
2025
- Group array items with Object.groupByGroup orders by status with Object.groupBy, read its null-prototype result, or use Map.groupBy to group by object identity.
- Use Promise.withResolvers to wrap callbacksUse Promise.withResolvers to await the result of a callback-driven operation and handle success or cancellation with the same promise.
- Collect async iterables with Array.fromAsyncCollect an async generator into an array, map pages as they arrive, and keep a loop when you need partial results.
- Find and fix lone surrogates in stringsUse isWellFormed to diagnose URIError from a split surrogate pair and toWellFormed to repair text before URL encoding.
- RegExp v flag for subtraction and intersectionWrite character classes with the v flag to subtract a Unicode set or keep the characters that two sets share.
- Sort and edit arrays without mutationUse toSorted(), toSpliced() and with() to make a shallow copy while preserving the source array and its order.
- Choose Promise.all or allSettledUse Promise.all when one failure should fail the whole step and allSettled when partial results are fine, then read each result by its status.