Javascript binding is done using the method. With the help of the bind method, we can make one common function and bind different objects, so that the function gives different results when it's needed. Otherwise, it gives the same result or gives an error while the code is executing. Bind() In short, when a function or method is invoked, the method allows us to easily set which object will be bound by keyword. bind() this info= { : , : { .write( .name);} } info.printFunc(); var name "XYZ" printFunc ( ) function document this // XYZ In the above example, there is no problem accessing the name, keyword bind the variable to the function. This is called . this name default binding This keyword will here point to object i.e info object. info = { : , : { .write( ); .write( .name); } } printFunc2= info.printFunc; printFunc2(); var name "XYZ" printFunc ( ) function document this // window object or undefined(strict mode). document this var In the above example, we are storing a reference of info.printFunc to printFunc2 variable. After that, we are calling it without an object reference, so this will now refer to the window (global) object or undefined (in strict mode). Hence, the binding of is lost, so no output is produced. this So basically, the method is used so that binding of is not lost. By using method we can set the context of to a particular object. Bind() this bind() this or in simple terms we can bind this How to use bind? 1. The bind() method creates a new function, when invoked, has the this sets to the provided value. See example below:- car1 = { : , : , } car2 = { : , : , } { .write( .name + + .color + ); } infoFunc.bind(car1)(); infoFunc.bind(car2)(); var name "swift" color "red" var name "alto" color "blue" ( ) function infoFunc document this " " this "<br/>" // swift red // alto blue There is one common function infoFunc() which is invoked 2times with different objects so that different results are produced. first binds to car1 object and then to car2 object. This 2. Function borrowing which means the bind() allows an object to borrow a method from another object without making a copy of that method. runner = { : , : { .write( .name + + speed + ); } }; flyer = { : , : { .write( .name + + speed + ); } }; run = runner.run.bind(flyer, ); run(); let name 'Runner' run ( ) function speed document this ' runs at ' ' mph.' let name 'Flyer' fly ( ) function speed document this ' flies at ' ' mph.' let 20 //Flyer runs at 20 mph. The flyer object is able to run, using the bind() method. The method creates the run() function with the this sets to the flyer object. How Binding came into existence? To set the this keyword independent of how the function is called, we use call, bind, and apply methods. These methods allow us to write a function once and invoke it in a different context. They all attach into a function (or object) and the difference is in the function invocation. In other words, they allow us to specify the value of this which will be used while the function is being executed. They also take any parameters to be passed to the original function when it is invoked. this