Use .bind() when you want that function to later be called with a certain context, useful in events. Use .call() or .apply() when you want to invoke the function immediately, and modify the context.

Call/apply call the function immediately, whereas bind returns a function that, when later executed, will have the correct context set for calling the original function. This way you can maintain context in async callbacks and events.

I do this a lot:

function MyObject(element) {
    this.elm = element;

    element.addEventListener('click', this.onClick.bind(this), false);
};

MyObject.prototype.onClick = function(e) {
     var t=this;  //do something with [t]...
    //without bind the context of this function wouldn't be a MyObject
    //instance as you would normally expect.
};

I use it extensively in Node.js for async callbacks that I want to pass a member method for, but still want the context to be the instance that started the async action.

A simple, naive implementation of bind would be like:

Function.prototype.bind = function(ctx) {
    var fn = this;
    return function() {
        fn.apply(ctx, arguments);
    };
};

There is more to it (like passing other args), but you can read more about it and see the real implementation on the MDN.

Answer from Chad on Stack Overflow
Top answer
1 of 16
921

Use .bind() when you want that function to later be called with a certain context, useful in events. Use .call() or .apply() when you want to invoke the function immediately, and modify the context.

Call/apply call the function immediately, whereas bind returns a function that, when later executed, will have the correct context set for calling the original function. This way you can maintain context in async callbacks and events.

I do this a lot:

function MyObject(element) {
    this.elm = element;

    element.addEventListener('click', this.onClick.bind(this), false);
};

MyObject.prototype.onClick = function(e) {
     var t=this;  //do something with [t]...
    //without bind the context of this function wouldn't be a MyObject
    //instance as you would normally expect.
};

I use it extensively in Node.js for async callbacks that I want to pass a member method for, but still want the context to be the instance that started the async action.

A simple, naive implementation of bind would be like:

Function.prototype.bind = function(ctx) {
    var fn = this;
    return function() {
        fn.apply(ctx, arguments);
    };
};

There is more to it (like passing other args), but you can read more about it and see the real implementation on the MDN.

2 of 16
531

They all attach this into function (or object) and the difference is in the function invocation (see below).

call attaches this into function and executes the function immediately:

var person = {  
  name: "James Smith",
  hello: function(thing) {
    console.log(this.name + " says hello " + thing);
  }
}

person.hello("world");  // output: "James Smith says hello world"
person.hello.call({ name: "Jim Smith" }, "world"); // output: "Jim Smith says hello world"

bind attaches this into function and it needs to be invoked separately like this:

var person = {  
  name: "James Smith",
  hello: function(thing) {
    console.log(this.name + " says hello " + thing);
  }
}

person.hello("world");  // output: "James Smith says hello world"
var helloFunc = person.hello.bind({ name: "Jim Smith" });
helloFunc("world");  // output: Jim Smith says hello world"

or like this:

...    
var helloFunc = person.hello.bind({ name: "Jim Smith" }, "world");
helloFunc();  // output: Jim Smith says hello world"

apply is similar to call except that it takes an array-like object instead of listing the arguments out one at a time:

function personContainer() {
  var person = {  
     name: "James Smith",
     hello: function() {
       console.log(this.name + " says hello " + arguments[1]);
     }
  }
  person.hello.apply(person, arguments);
}
personContainer("world", "mars"); // output: "James Smith says hello mars", note: arguments[0] = "world" , arguments[1] = "mars"                                     
🌐
freeCodeCamp
freecodecamp.org › news › understand-call-apply-and-bind-in-javascript-with-examples
How to Use the Call, Apply, and Bind Functions in JavaScript – with Code Examples
April 3, 2025 - The only difference is that in apply you can pass an array as an argument list. Bind is a function that helps you create another function that you can execute later with the new context of this that is provided.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › explain-call-apply-and-bind-methods-in-javascript
Explain call(), apply(), and bind() methods in JavaScript - GeeksforGeeks
This works like the native call() method. The only difference from the bind polyfill is that MyCall does not return a new function - just like JavaScript’s built-in call().
Published   January 22, 2026
🌐
Medium
medium.com › @jhawleypeters › javascript-call-vs-apply-vs-bind-61447bc5e989
Javascript Function Methods: Call vs Apply vs Bind | by Jonathan Hawley-Peters | Medium
November 22, 2019 - One second later, speak() is called in the context of cat. If we held onto the bound function for longer and kept invoking it, it would always be invoked in the context of cat, even if we stored it as a method on some other object. Bind can do a lot more, and the MDN page on Function.prototype.bind() is a great place to start.
🌐
DEV Community
dev.to › codecraftjs › understanding-call-apply-and-bind-essential-methods-in-javascript-d62
Understanding Call, Apply, and Bind: Essential Methods in JavaScript - DEV Community
May 23, 2023 - The call() and apply() methods are used to immediately invoke a function with a specified this value and arguments, while the bind() method returns a new function with a specified this value that can be called later.
🌐
DEV Community
dev.to › hebashakeel › difference-between-call-apply-and-bind-4p98
Difference between call,apply and bind - DEV Community
May 7, 2022 - This means that we can call any ... allows you to pass in arguments as an array. Bind(): returns a new function, allowing you to pass in an array and any number of arguments....
🌐
Codementor
codementor.io › community › how-to: call() , apply() and bind() in javascript
How-to: call() , apply() and bind() in JavaScript | Codementor
June 5, 2017 - You can use call()/apply() to invoke the function immediately. bind() returns a bound function that, when executed later, will have the correct context ("this") for calling the original function.
🌐
W3Schools
w3schools.com › js › js_function_bind.asp
JavaScript Function bind() Method
Make sure you understand this, call(), and apply() first. ... The bind() method creates a new function.
Find elsewhere
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript tutorial › javascript bind() method
JavaScript bind() Method and Its Practical Applications
October 6, 2023 - Summary: in this tutorial, you will learn about the JavaScript bind() method and know how to use it effectively. The bind() method returns a new function, when invoked, has its this sets to a specific value. The following illustrates the syntax of the bind() method: fn.bind(thisArg[, arg1[, arg2[, ...]]])Code language: CSS (css) In this syntax, the bind() method returns a copy of the function fn with the specific this value (thisArg) and arguments (arg1, arg2, …). Unlike the call() and apply() methods, the bind() method doesn’t immediately execute the function.
🌐
Educative
educative.io › answers › what-is-the-difference-between-call-apply-bind
What is the difference between call() apply() & bind() ?
In the above code, we bind the this value for the test function and invoke the returned function from the bind method. call: binds the this value, invokes the function, and allows you to pass a list of arguments.
🌐
Medium
medium.com › @rabailzaheer › exploring-call-apply-and-bind-methods-in-javascript-6023627c7bdc
Exploring Call, Apply, and Bind Methods in JavaScript
September 26, 2023 - JavaScript's call, apply, and bind methods. Learn their key differences, syntax, and use cases with practical examples to improve your coding skills
🌐
W3Schools
w3schools.com › js › js_function_call.asp
JavaScript Function call() Method
If you need a new function that remembers this, use bind() instead. ... Always know what this should refer to. What is the main difference between call() and a normal function call? ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
W3Schools
w3schools.com › js › js_function_apply.asp
JavaScript Function apply() Method
They do not return a new function. function sum(a, b) { return a + b; } sum.apply(null, [4, 5]); If you want a function that can be called later with the same this, use bind() instead.
🌐
Medium
medium.com › @leonardobrunolima › javascript-tips-apply-vs-call-vs-bind-d738a9e8b4e1
Javascript tips — Apply vs. Call vs. Bind | by Leonardo Bruno Lima | Medium
April 26, 2018 - Hi! Today I’ll talk about the differences between apply vs. call vs. bind. These JavaScript methods allow you to change the value of ‘this’ for a given function.
🌐
freeCodeCamp
freecodecamp.org › news › the-difference-between-javascripts-call-apply-and-bind-methods-4e69917f77bd
The difference between JavaScript’s call, apply, and bind methods
December 11, 2018 - Ways to remember: “Call’s arguments are separated by commas” or “CC”. **bind(this)**: Returns a new function whose this value is bound to the provided value.
🌐
SheCodes
shecodes.io › athena › 65300-what-is-the-difference-between-bind-call-and-apply-in-javascript
[JavaScript] - What is the difference between bind, call, and apply in JavaScript?
Learn how to use bind, call, and apply in JavaScript to set the value of this in a function and call the function with a given this value.
🌐
CodeSweetly
codesweetly.com › call-apply-bind-javascript
call() vs apply() vs bind() in JavaScript | CodeSweetly
In contrast, call() automatically invokes the method on which you used it. Let’s take a closer look at its syntax. ... The first argument you pass into bind() will refer to the object to which you want to assign a method.
🌐
Tania's Website
taniarascia.com › understanding this, bind, call, and apply in javascript
Understanding This, Bind, Call, and Apply in JavaScript | Tania Rascia's Website
In all of the previous examples, the value of this was determined by its context—whether it is global, in an object, in a constructed function or class, or on a DOM event handler. However, using call, apply, or bind, you can explicitly determine what this should refer to.
🌐
Medium
medium.com › @omergoldberg › javascript-call-apply-and-bind-e5c27301f7bb
Javascript: call(), apply() and bind() | by Omer Goldberg | Medium
July 3, 2018 - What that means, is that we can call any function, and explicitly specify what this should reference within the calling function. Really similar to the bind() method!