Variation 🎲
Utility functions to add variations to any kind of output.
Usage Example
const random chance randomItem = ; console;
API
Table of Contents
random
Returns a random argument.
Parameters
args
...any
randomItem
Returns a random item from the given array.
Parameters
array
Array<any>
chance
Returns value
with the given probability, false
otherwise.
Parameters
probability
number (optional, default0.5
)value
any (optional, defaulttrue
)
License
MIT