@yantrix/functions v0.0.2 • Docs
Yantrix API / @yantrix/functions / Transformers / shuffle
Function: shuffle()
shuffle(collection)
ts
function shuffle<T>(collection): T[]
Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
Type Parameters
• T
Parameters
• collection: undefined
| null
| List
<T
>
The collection to shuffle.
Returns
T
[]
Returns the new shuffled array.
shuffle(collection)
ts
function shuffle<T>(collection): T[keyof T][]
Type Parameters
• T extends object
Parameters
• collection: undefined
| null
| T
Returns
T
[keyof T
][]
See
_.shuffle