Returns random element.
const v = [`blue`, `red`, `orange`];randomElement(v); // Yields `blue`, `red` or `orange` Copy
const v = [`blue`, `red`, `orange`];randomElement(v); // Yields `blue`, `red` or `orange`
Use randomIndex if you want a random index within array.
array
Random generator. Math.random by default.
Math.random
Returns random element.
Use randomIndex if you want a random index within
array
.