Returns random elements from an array.
function randomItems<T>(arr: T[], n: number): T[]
// Example:
randomItems([1, 2, 3, 4, 5, 6], 1) //=> [3]
randomItems([1, 2, 3, 4, 5, 6], 3) //=> [2, 1, 5]
Returns random elements from an array.
function randomItems<T>(arr: T[], n: number): T[]
// Example:
randomItems([1, 2, 3, 4, 5, 6], 1) //=> [3]
randomItems([1, 2, 3, 4, 5, 6], 3) //=> [2, 1, 5]