Format currency and numbers with Intl
Locale-aware money, percent and compact number formatting using the built-in Intl.NumberFormat.
Browser and Node.js utilities, async patterns and DOM helpers.
Loading snippets…
29 snippets
Locale-aware money, percent and compact number formatting using the built-in Intl.NumberFormat.
Convert a byte count into a short human-readable size such as 1.5 MB.
Flatten arrays to any depth with a small recursive helper that mirrors Array.prototype.flat.
Recursively merge configuration objects without mutating the inputs and without prototype pollution.
Compare two values structurally, including nested objects, arrays, Dates, Maps and Sets.
Copy nested objects, arrays, Maps, Sets and Dates without sharing references, using the built-in structuredClone.
Turn a multi-argument function into one that can be called a few arguments at a time.
Chain single-argument functions left-to-right with pipe, or right-to-left with compose.
Small numeric helpers for sliders, animations and progress bars.
Uppercase the first letter of a string or of every word, leaving the rest of each word untouched.
Run a function at most once per interval, calling immediately and again at the end of a burst.
Retry a failing promise-returning function with growing, jittered delays and a retry predicate.