• Returns an unordered/random generator over the input itrable. Note that this is forced to materialize the input before running.

    Parameters

    • it: Iterable<any>

      The iterable to get items from

    • count: number = -1

      The number of items to return. All items are returned if count < 0. Default is -1

    Returns Generator<any, void, unknown>

    Example

    import { random } from 'deleight/generators';
    const unOrdered = random([1, 2, 3, 4]); // probably [4, 1, 3, 2]