Bound invocation

suggest change

bind 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"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents