Like _.isEqual, but accepts a customizer to decide how values compare. If the customizer returns undefined, Lodash falls back to default deep equality. Since Lodash 4.0.0.
Pass the value you want to inspect or convert. Read the return type carefully before you use the result.
Syntax
Call _.isEqualWith. Start with this line.
Lodash
_.isEqualWith(value, other, customizer)
Call
What it does
_.isEqualWith(value, other, customizer)
Primary signature.
_.isEqualWith(value)
Check, compare, clone, or convert a value.
Prefer import isEqualWith from "lodash/isEqualWith" when you want a smaller bundle.
Library declarations
Lodash
_.isEqualWith(value, other, customizer)
Parameters
Parameter
Description
value
Required. First value to compare
other
Required. Second value to compare
customizer
Optional. Optional compare hook (*omit → like isEqual)
Return Value
Return Value
Description
*
true if equivalent, else false
Lodash Examples
Example 1 — Official: Greeting Customizer
Treat hi and hello as the same string for equality.
Lodash
function isGreeting(value) {
return /^h(?:i|ello)$/.test(value);
}
function customizer(objValue, othValue) {
if (isGreeting(objValue) && isGreeting(othValue)) {
return true;
}
}
var array = ["hello", "goodbye"];
var other = ["hi", "goodbye"];
_.isEqualWith(array, other, customizer);
// → true
_.isEqual(array, other);
// → false
Object shell returns undefined → nested walk applies near to score.
Use case. Tests and UI state where float noise is expected.
Compatibility
Browser & Runtime Support
_.isEqualWith is a Lodash Lang helper (since 4.0.0). It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.0.0+
_.isEqualWith()
Available in [email protected] full builds and the lodash/isEqualWith 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
_.isEqualWithLodash 4.0.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import isEqualWith from "lodash/isEqualWith". Use plain isEqual when you do not need a customizer.
Frequently Asked Questions
Like _.isEqual, but you pass a customizer. If it returns undefined, Lodash handles that pair with default deep equality. Any other return is coerced to a boolean.
Return undefined for pairs you want Lodash to compare normally (including nested recursion). Return true or false only when you want to override the result.
Up to six: (objValue, othValue [, index|key, object, other, stack]). Nested walks may include key/index and parent objects.
_.isEqual uses Lodash defaults only. _.isEqualWith lets you treat some values as equal (or force unequal) before the default logic runs.
Lodash 4.0.0. Prefer import isEqualWith from "lodash/isEqualWith" for tree-shaking.
Yes — isMatchWith is the partial-match cousin. Use isEqualWith for full deep equality with custom rules.