Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/zipWith

Index

References

Type aliases

Functions

References

Renames and re-exports zipWith

Type aliases

MapFunc<U, V, R>: (a: U, b: V) => R

Type parameters

  • U

  • V

  • R

Type declaration

    • (a: U, b: V): R
    • Parameters

      • a: U
      • b: V

      Returns R

Functions

  • zipWith<U, V, R>(fn: MapFunc<U, V, R>, list1: ArrayLike<U>, list2: ArrayLike<V>): R[]
  • zipWith<U, V, R>(fn: MapFunc<U, V, R>, list1: ArrayLike<U>): (list2: ArrayLike<V>) => R[]
  • zipWith<U, V, R>(fn: MapFunc<U, V, R>): CurriedFunction2<ArrayLike<U>, ArrayLike<V>, R[]>
  • Creates a new list out of the two supplied by applying the function to each equally-positioned pair in the lists. The returned list is truncated to the length of the shorter of the two input lists.

    example
     var f = (x, y) => {
    // ...
    };
    zipWith(f, [1, 2, 3], ['a', 'b', 'c']);
    //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]

    Type parameters

    • U

    • V

    • R

    Parameters

    • fn: MapFunc<U, V, R>

      The function used to combine the two elements into one value.

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

    Returns R[]

    The list made by combining same-indexed elements of a and b using fn.

  • Creates a new list out of the two supplied by applying the function to each equally-positioned pair in the lists. The returned list is truncated to the length of the shorter of the two input lists.

    example
     var f = (x, y) => {
    // ...
    };
    zipWith(f, [1, 2, 3], ['a', 'b', 'c']);
    //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]

    Type parameters

    • U

    • V

    • R

    Parameters

    • fn: MapFunc<U, V, R>

      The function used to combine the two elements into one value.

    • list1: ArrayLike<U>

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

    The list made by combining same-indexed elements of a and b using fn.

      • (list2: ArrayLike<V>): R[]
      • Parameters

        • list2: ArrayLike<V>

        Returns R[]

  • Creates a new list out of the two supplied by applying the function to each equally-positioned pair in the lists. The returned list is truncated to the length of the shorter of the two input lists.

    example
     var f = (x, y) => {
    // ...
    };
    zipWith(f, [1, 2, 3], ['a', 'b', 'c']);
    //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]

    Type parameters

    • U

    • V

    • R

    Parameters

    • fn: MapFunc<U, V, R>

      The function used to combine the two elements into one value.

    Returns CurriedFunction2<ArrayLike<U>, ArrayLike<V>, R[]>

    The list made by combining same-indexed elements of a and b using fn.

Generated using TypeDoc