@sapphire/utilities
Version:
Common JavaScript utilities for the Sapphire Community
10 lines (8 loc) • 336 B
text/typescript
/**
* Picks a random element from an array
* @param array The array to pick a random element from
* @param amount Amount of values to obtain randomly (default: 1)
*/
declare function pickRandom<T>(array: readonly T[], amount?: 1): T;
declare function pickRandom<T>(array: readonly T[], amount: number): T[];
export { pickRandom };