UNPKG

gamekit-utils

Version:

Minimal, fast and useful utilities for randomness, array manipulation and math — built for games, UI logic and generative design.

10 lines (9 loc) 274 B
/** * Returns a new array with the same elements in random order (Fisher–Yates). * * Note: Only the array structure is copied. Objects inside are not cloned. * * @example * shuffle([1, 2, 3]); // → [2, 3, 1] */ export declare const shuffle: <T>(arr: T[]) => T[];