0f3060dcf3
Co-authored-by: Cursor <cursoragent@cursor.com>
8 lines
235 B
TypeScript
8 lines
235 B
TypeScript
export function randomInt(min: number, max: number): number {
|
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
}
|
|
|
|
export function randomPick<T>(arr: readonly T[]): T {
|
|
return arr[Math.floor(Math.random() * arr.length)];
|
|
}
|