Lodash _.isMatch() Method
The Lodash _.isMatch() Method performs a partial deep comparison between object and source to determine if the object contains equivalent property values. Due to partial comparisons, it will match empty array and empty object source values against any array or object value, respectively.
_.isMatch( object, source )
Parameters: This method accepts two parameters as mentioned above and described below:
- object: Object in which source is to be matched.
- source: Source which is to be matched.
Return Value: This method returns a Boolean value(Returns true if the source and the given object match, else false).
Example 2: For checking with an empty source this method returns true.
Example 3: This method also works for arrays.