Simple object with the method
In the above example, I just console an object method that will simply return this function. Now just come to bind() method
bind() method created a new function and bound another object while calling an object method. This method doesn’t execute the invoked function because it returns a new function with the bounded object. Please see the following example
In the above example, you will see a function will be displayed into the console. bind() method will bound an object nameObj but return a new function for later use.
Please see the directory by this code console.dir(personObj.getAddress.bind(nameObj));
In the above result, you can see nameObj object properties are bounded so you can use it by this keyword. You can now call the bounded function like this.
I hope you had a basic idea of the bind() method. Thanks for your time.