zipObject es-toolkit
Creates a single object from a keys array and a values array.
Usage
zipObject(keys, values)
Use zipObject when you want to combine two arrays into a single object. It returns a new object where elements from the first array become keys and elements from the second array become values.
If the values array is longer, excess values are ignored.
Parameters
keysreadonly P[]required
The array that will become the object's keys.
valuesreadonly V[]required
The array of values corresponding to each key.
Returns
Returns a new object with keys and values combined.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.