Function sample

  • Get a random element from an array.

    Parameters

    • array: any[]

      An array.

    Returns any

    A random element from an array.

    Since

    0.4.2

    Example

    sample([1, 2, 3])
    // => 1, 2, or 3