Uniformly shuffle an array in place using the modern Fisher-Yates algorithm. Returns the same array for chaining. Use crypto.getRandomValues for cryptographic uses.
Slice an array into chunks of a given size while preserving the original keys in each chunk. Useful for paginating ordered datasets without losing the row IDs.
Pair items from two arrays positionally into tuples. The result's length is the shorter of the two inputs. Useful for parallel arrays (labels + values, headers + rows).
Bash 4+ arrays — declare, access by index, get all elements with [@], length with #. The quoting matters: "${arr[@]}" preserves each element; ${arr[@]} word-splits.
Group a list into a record keyed by whatever the callback returns. Like Lodash _.groupBy or the new Object.groupBy in modern runtimes. Generic enough to handle string, number, or symbol keys.
A generator-based numeric range: `[start, end)` with an optional step. Lazy so it doesn't allocate a huge array up front; consume with for…of or Array.from.
The descriptive-stat trio for number[]. Median sorts a copy so the input is left alone. Empty input returns 0 / 0 / 0 rather than NaN — opinionated, but predictable.
Mutate a nested array by dot path, auto-creating any intermediate arrays. Companion to getPath; together they replace a lot of isset+array_key_exists ladders.
Like array_unique, but the uniqueness test is a callback that returns the key to dedupe by. Useful for "unique by ID" or "unique by lowercased email" across arrays of objects/rows.
Extract a single column from a list of associative arrays into a flat list. Common transformation for SELECT results — equivalent to array_column with optional indexing key.