Builds a plain object from two parallel arrays: property names and values. Like _.fromPairs, but keys and values live in separate arrays (same idea as fromPairs(zip(props, values))). Part of Lodash 4.x Array.
Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.zipObject on an array. Start with this line.
Lodash
_.zipObject([props=[]], [values=[]])
Call
What it does
_.zipObject([props=[]], [values=[]])
Primary signature.
_.zipObject(array)
Call with an array argument.
Prefer import zipObject from "lodash/zipObject" when you want a smaller bundle.
_.zipObject is a Lodash 4.x Array helper. It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.zipObject()
Available in [email protected] full builds and the lodash/zipObject modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.zipObjectLodash 4.x+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import zipObject from "lodash/zipObject" for smaller builds. Not a native browser API — load Lodash first.
Frequently Asked Questions
_.zipObject(props, values) builds a plain object by pairing each property name from props with the value at the same index in values.
No. It returns a new object. The keys and values arrays stay unchanged.
Missing values become undefined for those keys. Extra values beyond the last key are ignored.
Assignments run in order — the last value for that property name wins.
fromPairs takes [[key, value], ...] rows. zipObject takes two parallel arrays: one of keys and one of values. Same idea as fromPairs(zip(keys, values)).
Use import zipObject from "lodash/zipObject" or require("lodash/zipObject") for tree-shaking. Full build: import _ from "lodash" then _.zipObject.