Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/zip

Index

References

Functions

References

Renames and re-exports zip

Functions

  • zip<U, V>(list1: ArrayLike<U>, list2: ArrayLike<V>): [U, V][]
  • zip<U>(list1: ArrayLike<U>): <V>(list2: ArrayLike<V>) => [U, V][]
  • Creates a new list out of the two supplied by pairing up equally-positioned items from both lists. The returned list is truncated to the length of the shorter of the two input lists.

    example
     zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]
    

    Type parameters

    • U

    • V

    Parameters

    • list1: ArrayLike<U>
    • list2: ArrayLike<V>

    Returns [U, V][]

    The list made by pairing up same-indexed elements of a and b.

  • Creates a new list out of the two supplied by pairing up equally-positioned items from both lists. The returned list is truncated to the length of the shorter of the two input lists.

    example
     zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]
    

    Type parameters

    • U

    Parameters

    • list1: ArrayLike<U>

    Returns <V>(list2: ArrayLike<V>) => [U, V][]

    The list made by pairing up same-indexed elements of a and b.

      • <V>(list2: ArrayLike<V>): [U, V][]
      • Type parameters

        • V

        Parameters

        • list2: ArrayLike<V>

        Returns [U, V][]

Generated using TypeDoc