UNPKG

just-random

Version:

return a randomly selected element in an array

4 lines (3 loc) 150 B
declare function random<Head, Rest>(arr: [Head, ...Rest[]]): Head | Rest; declare function random<T>(arr: T[]): T | undefined; export default random;