JavaScript Tested
Group an array of objects by a key
Build an object of arrays keyed by a property or computed value, using Object.groupBy or a reduce fallback.
Browser and Node.js utilities, async patterns and DOM helpers.
Loading snippets…
29 snippets
Build an object of arrays keyed by a property or computed value, using Object.groupBy or a reduce fallback.
Turn a date into a localized relative string using Intl.RelativeTimeFormat, with no library.
Delay a function call until the caller has stopped invoking it for a given time, with cancel support.
Use the async Clipboard API with a legacy fallback and report success or failure to the user.
Break an array into fixed-size pieces, useful for batching API calls or database inserts.