Skip to content

choices

choices<T>(items, k): T[]

Defined in: src/global/collections.ts:80

k elements with replacement, so k may exceed the collection size.

T

Collection<T>

number

T[]

choices(["a", "b"], 5); // [ "b", "b", "a", "b", "a" ]