Function: pickRandom()
pickRandom(array, amount)
pickRandom<
T
>(array
: readonlyT
[],amount
?:1
):T
Picks a random element from an array
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
array | readonly T [] | The array to pick a random element from |
amount ? | 1 | Amount of values to obtain randomly (default: 1) |
Returns
T
Defined in
pickRandom(array, amount)
pickRandom<
T
>(array
: readonlyT
[],amount
:number
):T
[]
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
array | readonly T [] |
amount | number |
Returns
T
[]