Like _.isMatch, but accepts a customizer to compare values. If the customizer returns undefined, Lodash handles the comparison. Part of Lodash Lang since 4.0.0 (stable — not deprecated).
Pass the value you want to inspect or convert. Read the return type carefully before you use the result.
Syntax
Call _.isMatchWith. Start with this line.
Lodash
_.isMatchWith(object, source, customizer)
Call
What it does
_.isMatchWith(object, source, customizer)
Primary signature.
_.isMatchWith(value)
Check, compare, clone, or convert a value.
Prefer import isMatchWith from "lodash/isMatchWith" when you want a smaller bundle.
Library declarations
Lodash
_.isMatchWith(object, source, customizer)
Parameters
Parameter
Description
object
Required. The object to inspect
source
Required. Property values that must match
customizer
Optional. Compare values; omit-like when unused (pass a function)
Return Value
Return Value
Description
*
true if object matches source, else false
Lodash Examples
Example 1 — Official: Greeting Customizer
Treat related greeting strings as a match.
Lodash
function isGreeting(value) {
return /^h(?:i|ello)$/.test(value);
}
function customizer(objValue, srcValue) {
if (isGreeting(objValue) && isGreeting(srcValue)) {
return true;
}
}
var object = { 'greeting': 'hello' };
var source = { 'greeting': 'hi' };
_.isMatchWith(object, source, customizer);
// → true
Other types. Returning nothing keeps default compare.
Result."Chennai" matches "chennai".
Compatibility
Browser & Runtime Support
_.isMatchWith is a Lodash Lang helper (available since 4.0.0, stable in 4.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.0.0+
_.isMatchWith()
Available in [email protected] full builds and the lodash/isMatchWith 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
_.isMatchWithLodash 4.0.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isMatchWith from "lodash/isMatchWith" for smaller builds. Use _.isMatch when you do not need a customizer.
Frequently Asked Questions
_.isMatchWith(object, source, customizer) is like _.isMatch, but each compared value pair can go through your customizer. Return true to force a match, false to reject, or undefined to use Lodash’s default comparison.
Same partial-match rules (only source keys matter). The customizer lets you treat related values as equal — for example greeting strings "hello" and "hi".
The customizer is invoked with (objValue, srcValue, index|key, object, source).
If a source key is missing on the object, the match fails in a pre-check before deep comparison — so the customizer may not run for that case.
Same customization idea. isEqualWith compares whole structures; isMatchWith only checks properties present in source.
Use import isMatchWith from "lodash/isMatchWith" or require("lodash/isMatchWith"). Full build: import _ from "lodash" then _.isMatchWith.