Lodash _.bindKey() Method Last Updated : 03 Sep, 2024 Comments Improve Suggest changes Like Article Like Report Lodash _.bindKey() method of Function in lodash is used to create a function that calls the method at the object[key] along with the partials added to the arguments it accepts.Note:This method is different from the _.bind() method as it permits bound functions to mention methods that may be reinterpreted or do not still exist.The _.bindKey.placeholder value that is by default ( _ ) in monolithic builds which is utilized as a placeholder for partially used arguments.Syntax:_.bindKey(object, key, partials);Parameters: object: It is the object that is used to call the method.key: It is the key to be used in the method.partials: It is the arguments that are to be partially applied. It is an optional parameter.Return Value: This method returns the new bound function.Example 1: In this example, we are passing partials to the function and printing the result into the console by the use of the lodash _.bindKey() method. JavaScript // Requiring lodash library const _ = require('lodash'); // Defining object parameter of this method let obj = { 'author': 'Nidhi', 'welcome': function (greet, mark) { return greet + ' ' + this.author + mark; } }; // Using the _.bindKey() method // with its parameters let bound_fun = _.bindKey(obj, 'welcome', 'Hello'); // Calling bound_fun by passing its value console.log(bound_fun('!!')); Output:Hello Nidhi!!Example 2: In this example, we are passing partials to the function and using a bound with the placeholder then printing the result into the console by the use of the lodash _.bindKey() method. JavaScript // Requiring lodash library const _ = require('lodash'); // Defining object parameter of this method let obj = { 'portal': function (portal, mark) { return 'Welcome to ' + portal + mark; } }; // Using the _.bindKey() method with its // parameters and a placeholder let bound_fun = _.bindKey(obj, 'portal', _, '!'); // Calling bound_fun by passing its value console.log(bound_fun('GeeksforGeeks')); Output:Welcome to GeeksforGeeks! Create Quiz Comment N nidhi1352singh Follow 0 Improve N nidhi1352singh Follow 0 Improve Article Tags : JavaScript Web Technologies JavaScript-Lodash Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)8 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like