• Interweaves two sequences.

    Example

    const numbers = [1, 2];
    const moreNumbers = interweave(numbers, [3, 4, 5]); // [1, 3, 2, 4, 5]

    Typeparam

    TSource The type of the source iterable.

    Returns

    An IEnumerable that contains the interweaved elements of the two input sequences.

    Type Parameters

    • TSource

    Parameters

    • src: Iterable<TSource>

      The source iterable.

    • collection: Iterable<TSource>

      The sequence to interweave to the first sequence.

    Returns IEnumerable<TSource>

  • Interweaves multiple sequences.

    Example

    const numbers = [1, 2];
    const evenMoreNumbers = interweave(numbers, [3, 4], [5, 6]); // [1, 3, 5, 2, 4, 6]

    Typeparam

    TSource The type of the source iterable.

    Returns

    An IEnumerable that contains the interweaved elements of the two or more input sequences.

    Type Parameters

    • TSource

    Parameters

    • src: Iterable<TSource>

      The source iterable.

    • Rest ...collections: Iterable<TSource>[]

      The sequences to interweave to the first sequence.

    Returns IEnumerable<TSource>

Generated using TypeDoc