choose<T>(lst: T[]): T

Choose a random item from a list.

paramlst- The list to choose from.

// decide the best fruit randomly
const bestFruit = choose(["apple", "banana", "pear", "watermelon"]);

returnsA random item from the list.

sincev3001.0