sample (Functional Programming) es-toolkit
Creates a function that returns a random value from an array. Use it with pipe.
Info
Usage
sample returns one random value from the piped array.
Parameters
This function takes no arguments; call it as sample().
Returns
A function that maps a readonly T[] to one random value.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.