isMatch

Lang
since 3.0.0

Arguments

  • Object The object to inspect.
  • Object The object of property values to match.

Returns

boolean `true` if `object` is a match, else `false`.

Performs a partial deep comparison between object and source to determine if object contains equivalent property values.

Note: This method is equivalent to _.matches when source is partially applied.

Partial comparisons will match empty array and empty object source values against any array or object value, respectively. See _.isEqual for a list of supported value comparisons.

Example of Lodash _.isMatch

var object = { 'a': 1, 'b': 2 };

_.isMatch(object, { 'b': 2 });
// => true

_.isMatch(object, { 'b': 1 });
// => false