Function zipObject

  • This method is like fromPairs except that it accepts two arrays, one of property identifiers and one of corresponding values.

    Type Parameters

    • T extends PropertyName[]
    • K extends any[]
    • U extends number = BuildIndexUnion<T["length"], []>

    Parameters

    • Optionalprops: T

      The property identifiers.

    • Optionalvalues: K

      The property values.

    Returns {
        [P in U as T[P]]: K[P]
    }

    Returns the new object.

    0.4.0

    unzip, unzipWith, zip, zipObjectDeep, zipWith

    zipObject(['a', 'b'], [1, 2])
    // => { 'a': 1, 'b': 2 }