@monstermann/fn
Version:
A utility library for TypeScript.
22 lines • 430 B
TypeScript
//#region src/array/shuffle.d.ts
/**
* `shuffle(array)`
*
* Returns a new array with the elements of `array` randomly shuffled.
*
* ```ts
* shuffle([1, 2, 3, 4]); // [3, 1, 4, 2] (random)
* ```
*
* ```ts
* pipe(
* [1, 2, 3, 4],
* shuffle(),
* ); // [3, 1, 4, 2] (random)
*/
declare const shuffle: {
(): <T>(target: readonly T[]) => T[];
<T>(target: readonly T[]): T[];
};
//#endregion
export { shuffle };