Bindings vs Function.prototype.bind()

I know what the word bind means I just dont know if JavaScript has another definition for it. I see the word binding a lot so I want to know what binding means in JavaScript. Is it just talking about Function.prototype.bind() or its return value?

1 Like

From the MDN docs:

The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.

It works by “binding” the function to the context that you specify. Very often you use it to make sure that the surrounding this will be available to the function when it is called later.

This is a confusing subject, don’t be worried if complete understanding eludes you for now.

1 Like

I’d definitely encourage you to have a basic understanding of JavaScript’s this before diving too deeply into bind.

Once you have a basic grasp on this, then it’s worthwhile to look at bind, call, and apply - https://medium.freecodecamp.org/how-to-use-the-apply-call-and-bind-methods-in-javascript-80a8e6096a90