Bound invocation
suggest changebind returns a new function whose this is fixed to a specific object. That is useful when you pass a method somewhere that will call it without a receiver. An arrow function ignores the bound this.
const obj = { foo: 'bar' };
function foo() {
return this.foo;
}
const fooObj = foo.bind(obj);
console.log(fooObj()); // "bar"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents