choose
choose(
@choices ? ## list (required)
@n 1
@weights null
) -> anything
Choose randomly one or more elements from a list, with optional probability weights.
Arguments
@choices ?
[list]: list to choose from. (required)@n
[int]: number of random choices. (default:1
).@weights
[list/null]: optional probability weights for each element. (default:null
).
Output
chosen elements [anything]