Lodash _.matches() Method Last Updated : 25 Oct, 2023 Comments Improve Suggest changes Like Article Like Report Lodash _.matches method creates a function that performs a partial deep comparison between a given object and source, returning true if the given object has equivalent property values, else false. Syntax:_.matches(source);Parameter:source: The object of property values to match.Return Value:It returns the new spec function. Example 1: In this example, we are printing the matching value to the given array of objects by using the _.matches() method. javascript // Requiring the lodash library const _ = require("lodash"); // Using _.matches() method let geek = [{ 'java': 3, 'python': 5, 'js': 7 }, { 'java': 4, 'python': 2, 'js': 6 } ]; let gfg = _.filter(geek, _.matches({ 'java': 3, 'js': 7 })); // Storing the Result console.log(gfg); Output: [Object {java: 3, js: 7, python: 5}]Example 2: In this example, we are printing the matching value to the given array of objects by using the _.matches() method. javascript // Requiring the lodash library const _ = require("lodash"); // Using _.matches() method let objects = [ { 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }, { 'a': 8, 'b': 7, 'c': 9 } ]; let gfg = _.filter(objects, _.matches({ 'a': 8 })); console.log(gfg) Output: [ {a: 8, b: 7, c: 9}] Comment More infoAdvertise with us J jana_sayantan Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Lodash Similar Reads Lodash _.bindAll() Method Lodash _.bindAll() method is used to bind the number of methods on the object. Each method is given a method name. It is handy to work with the event handlers. Syntax:_.bindAll(object, methodNames)Parameter: This method accepts two parameters as mentioned above and described below: object: It is the 2 min read Lodash _.cond() Method Lodash _.cond method creates a function that iterates over pairs and invokes the corresponding function of the first predicate to return truthy. The predicate-function pairs are invoked with the binding and arguments of the created function. Syntax:_.cond(pairs);Parameters: pairs: [Array]The predica 2 min read Lodash _.conforms() Method Lodash _.conforms() method of Util is used to create a function that calls the predicate properties of the source with the analogous property values of a stated object, which returns true if all the predicates are true else returns false. Syntax:_.conforms(source);Parameters: source (Object): It is 2 min read Lodash _.constant() Method Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. The _.constant method is used to create a function that returns value. Syntax: _.constant(value) Parameters: This method accepts one parameter as mentioned abov 1 min read Lodash _.defaultTo() Method Lodash _.defaultTo() method is used to check the given value and determine if a default value should be restored in its place. When the value is NaN, null, or undefined, the value given in the defaultValue parameter is returned. Syntax:_.defaultTo( value, defaultValue );Parameters: value: This param 1 min read Lodash _.flow() Method Lodash _.flow() method is used to generate a new composite function that returns the result of invoking the provided functions with the binding of the function generated. Each of the successive invocations is provided the return value of the previous. Syntax:_.flow([funcs]);Parameters: funcs: This p 2 min read Lodash _.flowRight() Method Lodash _.flowRight() method is used to create a new composite function that invokes the provided functions from right to left, where each of the successive invocations is provided the return value of the previous. It is almost the same as the _.flow() method. Syntax:_.flowRight(funcs);Parameters: fu 2 min read Lodash _.identity() Method Lodash _.identity method returns the first argument it receives. Syntax:_.identity(value);Parameters: value: It can be any value.Return Value:Returns the first argument it receives. Example 1: In this example, it is returning the first parameter because of the lodash _.identity() method. javascript 1 min read Lodash _.iteratee() Method Lodash_.iteratee method  creates a function that invokes func with the arguments of the created function. If func is a property name, the created function returns the property value for a given element. If func is an array or object, the created function returns true for elements that contain the eq 2 min read Lodash _.matches() Method Lodash _.matches method creates a function that performs a partial deep comparison between a given object and source, returning true if the given object has equivalent property values, else false. Syntax:_.matches(source);Parameter:source: The object of property values to match.Return Value:It retur 2 min read Like