Generate a random element from an array.
The array from which to select a random element.
A random element from the array.
const colors = ['red', 'blue', 'green', 'yellow'];const randomColor = RNG.element(colors);console.log(randomColor); // Output: e.g., "blue" Copy
const colors = ['red', 'blue', 'green', 'yellow'];const randomColor = RNG.element(colors);console.log(randomColor); // Output: e.g., "blue"
Generated using TypeDoc
Generate a random element from an array.