Creates a function that returns the opposite of a predicate’s result. The original predicate is called with the same this and arguments. Part of Lodash 4.x Function (since 3.0.0).
Pass the required arguments shown below. Most helpers return a new function you call later.
Syntax
Call _.negate. Start with this line.
Lodash
_.negate(predicate)
Call
What it does
_.negate(predicate)
Primary signature.
_.negate(func)
Wrap or transform a function.
Prefer import negate from "lodash/negate" when you want a smaller bundle.
Library declarations
Lodash
_.negate(predicate)
Parameters
Parameter
Description
predicate
Required. Function whose result is flipped
Return Value
Return Value
Description
*
New function → !predicate(...)
Lodash Examples
Example 1 — Official: Filter with _.negate(isEven)
Negate. Falsey inputs become true for the wrapper.
Filter. Keeps 0, "", and null.
Direct. Same wrapper works outside filter.
Compatibility
Browser & Runtime Support
_.negate is a Lodash 4.x Function helper (since 3.0.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. There is no single native Function.negate; a one-liner (...a) => !pred(...a) is equivalent, but Lodash keeps the helper consistent with other wrappers.
✓ Stable · Lodash 4.x
_.negate()
Available in [email protected] full builds and the lodash/negate 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
_.negateLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import negate from "lodash/negate" for smaller builds. Ideal for reusing an existing predicate in the opposite direction.
Frequently Asked Questions
_.negate(predicate) returns a new function that calls predicate with the same this and arguments, then returns the opposite boolean (!result).
No. It returns a new wrapper. The original function is unchanged.
negate wraps one predicate into its inverse. _.reject(collection, pred) keeps elements where pred is falsey — similar outcome to filter + negate, but reject is a collection helper.
Yes for one-off checks. Use _.negate when you need a reusable inverted function to pass into filter, find, every, or some.
Yes. Lodash invokes the original predicate with the this binding and arguments of the created function.
Use import negate from "lodash/negate" or require("lodash/negate") for tree-shaking. Full build: import _ from "lodash" then _.negate.