Copy. Own keys from original and { b: 2 } land on it.
original. Never passed as destination — stays { a: 1 }.
Pattern. Prefer this when mutation would surprise callers.
Compatibility
Browser & Runtime Support
_.extendOwn / _.assign ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 1.x
_.extendOwn()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
100%With Underscore 1.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
_.extendOwnUnderscore 1.x+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]). Native Object.assign is similar for own props in modern engines.
Frequently Asked Questions
_.extendOwn(destination, *sources) copies only the own enumerable properties from one or more sources into the destination and returns it. Inherited prototype properties are ignored.
_.assign is an alias for _.extendOwn — the same function. The name mirrors native Object.assign, which also copies own enumerable properties only.
_.extend copies all enumerable properties, including inherited ones. _.extendOwn copies only own properties, skipping the prototype chain.
Yes. It changes destination in place and returns it. Use _.extendOwn({}, source) when you want a new object.
Shallow. Nested objects and arrays are copied by reference — destination and source share those nested values.
When you want to merge plain own data and skip anything inherited from a prototype — closer to Object.assign than to _.extend.