API Reference

Returns a random element from an array.

function randomItem<T>(arr: T[]): T

// Example:

randomItem([1, 2, 3, 4, 5, 6]) //=> 3