Home > @infiniteobjects/core-library-web > Arrays > shuffle
Returns a copy of the array with the order of items randomized.
Signature:
static shuffle<T>(collection: T[]): T[];
Parameter | Type | Description |
---|---|---|
collection | T[] | Â |
Returns:
T[]
Uses the Durstenfeld algorithm which is based on the Fisher–Yates algorithm.