Performs a deep comparison between object and source to determine if object contains equivalent property values.
object
source
Note: This method supports comparing the same values as _.isEqual.
_.isEqual
The object to inspect.
The object of property values to match.
Returns true if object is a match, else false.
true
false
var object = { 'user': 'fred', 'age': 40 };_.isMatch(object, { 'age': 40 });// => true_.isMatch(object, { 'age': 36 });// => false Copy
var object = { 'user': 'fred', 'age': 40 };_.isMatch(object, { 'age': 40 });// => true_.isMatch(object, { 'age': 36 });// => false
Performs a deep comparison between
object
andsource
to determine ifobject
contains equivalent property values.Note: This method supports comparing the same values as
_.isEqual
.