Build a new object by dropping properties where a predicate returns truthy. Part of Lodash Object (stable — not deprecated). The predicate is invoked as (value, key). Opposite of _.pickBy.
Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.
Syntax
Call _.omitBy. Start with this line.
Lodash
_.omitBy(object, [predicate=_.identity])
Call
What it does
_.omitBy(object, [predicate=_.identity])
Primary signature.
_.omitBy(object)
Work with an object’s keys, values, or paths.
Prefer import omitBy from "lodash/omitBy" when you want a smaller bundle.
Library declarations
Lodash
_.omitBy(object, [predicate=_.identity])
Parameters
Parameter
Description
object
Required. Source object to filter
predicate
Optional. Invoked as (value, key); default _.identity
omitBy. Best when the rule depends on value or a pattern.
Same result. Both drop password here.
Choose. Prefer the shorter, clearer API for the job.
Compatibility
Browser & Runtime Support
_.omitBy is a Lodash Object helper available in 4.x. It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native equivalents loop Object.keys and copy keys the predicate rejects.
✓ Stable · Lodash 4.x
_.omitBy()
Available in [email protected] full builds and the lodash/omitBy 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
_.omitByLodash 4.x
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import omitBy from "lodash/omitBy" for smaller builds. Use omit for fixed key lists; pickBy when you want to keep matches.
Frequently Asked Questions
_.omitBy(object, [predicate]) builds a new object from own enumerable string keys, dropping any property where the predicate returns a truthy value. Official example: _.omitBy({ a: 1, b: '2', c: 3 }, _.isNumber) → { b: '2' }.
The predicate is invoked as predicate(value, key). Check the value for content rules, or the key for name-based rules.
No. It returns a new object and leaves the source unchanged.
_.omit() takes a fixed list of paths/keys. _.omitBy() decides per property with a runtime predicate.
They are opposites. _.omitBy() drops where the predicate is truthy; _.pickBy() keeps where the predicate is truthy.
The default is _.identity, so truthy values are omitted and only falsy values remain. Prefer an explicit predicate like _.isNil when you only want to drop null/undefined.