![]() |
VOOZH | about |
Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc. even without using any built-in objects.
The _.matcher() function is an inbuilt function in Underscore.js library of JavaScript which is used to find a predicate function which can inform you if a passed in object includes all the key-value properties that are given in the attrs parameter.
Syntax:
_.matcher(attrs)
Parameters: This function accepts a single parameter as mentioned above and described below:
Return value: This method returns a predicate function.
Example 1:
Output:
function(obj) { return isMatch(obj, attrs); }
Example 2: