Function zipObject

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

    Parameters

    • props: string[]

      The property identifiers.

    • values: any[]

      The property values.

    Returns any

    Returns the new object.

    5.3.0

    [[unzip]],[[unzipWith]],[[zip]],[[zipObjectDeep]],[[zipWith]]

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