Lodash _.bindKey() Method
The _.bindKey() method of Function in lodash is used to create a function which calls the method at the object[key] along with the partials added to the arguments it accepts.
- This method is different from the _.bind() method as it permits bound functions to mention methods that may be reinterpreted or does not still exist.
- The _.bindKey.placeholder value that is by default ( _ ) in monolithic builds which is utilized as a placeholder for partially used arguments.
_.bindKey( object, key, partials )
Parameters: This method accepts three parameters as mentioned above and described below:
- object: It is the object which is used to call the method on.
- key: It is the key to be used in the method.
- partials: It is the arguments which is to be partially applied. It is an optional parameter.
Return Value: This method returns the new bound function.
Example 2: Using a bound with the placeholder.
Welcome to GeeksforGeeks!