The basic idea behind call/apply/bind is the same: explicitly set function parameters including this. The context changes a bit, but the use cases will all be niche instances when the normal ways of setting function parameters (i.e. placing them between the parentheses or to the left of the dot for this) are not sufficient. Apply First, apply. You will almost certainly never need apply. Why? Because the common use case has been supplanted by a new syntax: the spread operator (...). In the past, if you had your parameters in an array, apply was the way to get them into a function. const nums = [1, 2, 3]; const largest = Math.max.apply(null, nums); console.log(largest); // 3 These days, spread is easier to write and read. const nums = [1, 2, 3]; const largest = Math.max(...nums); console.log(largest); // 3 Call Okay, call works a lot like just, well, calling a function. The only difference is that the this moves from the left of the dot to the first parameter between the parentheses. const nums = [1, 2, 3]; console.log(nums.includes(2)); // true console.log(Array.prototype.includes.call(nums, 2)); // true When is this useful? Mostly never. Cases occasionally come up. Sometimes you want to call one object's method on a different object. Call lets you do that. It is always very technical and niche. Bind Bind is probably the most useful of the three, which isn't saying much. It allows you to pass parameters to a function before you call it, creating a new function with those parameters baked in. const nums = [1, 2, 3]; const numsIncludesThree = Array.prototype.includes.bind(nums, 3); console.log(numsIncludesThree()); // true nums.pop(); console.log(numsIncludesThree()); // false This is kind of neat. It allows you to build up functions out of parameters, and is related to awesome concepts like "partially applying" functions, "factory" functions, and "currying". That said, you don't actually see bind used all that often. It is clunky compared to other options like lodash's partial , and most people who write code like this also religiously avoid using this, which will always be the first parameter bind takes. For awhile it was common to see people use bind in their class definitions: class User { constructor(name) { this.name = name; this.greet = this.greet.bind(this); } greet() { console.log(`Hello, ${this.name}!`); } } This allows you to use your class method in circumstances where the this would not be set, for example as a callback to another function like an event listener or setTimeout. const user = new User('Sue'); setTimeout(user.greet, 1000); // Hello, Sue! This approach has mostly fallen out of fashion though. Using bind in the constructor is just fighting the way JS works because you wish it worked like a different language, people don't even use classes all that often anymore, and there are more straightforward ways to accomplish the same behavior. setTimeout(() => { user.greet(); }, 1000); // Hello, Sue! (no bind required) TLDR If you need them, you'll know. But you mostly won't. Answer from delventhalz on reddit.com
Top answer
1 of 6
16
The basic idea behind call/apply/bind is the same: explicitly set function parameters including this. The context changes a bit, but the use cases will all be niche instances when the normal ways of setting function parameters (i.e. placing them between the parentheses or to the left of the dot for this) are not sufficient. Apply First, apply. You will almost certainly never need apply. Why? Because the common use case has been supplanted by a new syntax: the spread operator (...). In the past, if you had your parameters in an array, apply was the way to get them into a function. const nums = [1, 2, 3]; const largest = Math.max.apply(null, nums); console.log(largest); // 3 These days, spread is easier to write and read. const nums = [1, 2, 3]; const largest = Math.max(...nums); console.log(largest); // 3 Call Okay, call works a lot like just, well, calling a function. The only difference is that the this moves from the left of the dot to the first parameter between the parentheses. const nums = [1, 2, 3]; console.log(nums.includes(2)); // true console.log(Array.prototype.includes.call(nums, 2)); // true When is this useful? Mostly never. Cases occasionally come up. Sometimes you want to call one object's method on a different object. Call lets you do that. It is always very technical and niche. Bind Bind is probably the most useful of the three, which isn't saying much. It allows you to pass parameters to a function before you call it, creating a new function with those parameters baked in. const nums = [1, 2, 3]; const numsIncludesThree = Array.prototype.includes.bind(nums, 3); console.log(numsIncludesThree()); // true nums.pop(); console.log(numsIncludesThree()); // false This is kind of neat. It allows you to build up functions out of parameters, and is related to awesome concepts like "partially applying" functions, "factory" functions, and "currying". That said, you don't actually see bind used all that often. It is clunky compared to other options like lodash's partial , and most people who write code like this also religiously avoid using this, which will always be the first parameter bind takes. For awhile it was common to see people use bind in their class definitions: class User { constructor(name) { this.name = name; this.greet = this.greet.bind(this); } greet() { console.log(`Hello, ${this.name}!`); } } This allows you to use your class method in circumstances where the this would not be set, for example as a callback to another function like an event listener or setTimeout. const user = new User('Sue'); setTimeout(user.greet, 1000); // Hello, Sue! This approach has mostly fallen out of fashion though. Using bind in the constructor is just fighting the way JS works because you wish it worked like a different language, people don't even use classes all that often anymore, and there are more straightforward ways to accomplish the same behavior. setTimeout(() => { user.greet(); }, 1000); // Hello, Sue! (no bind required) TLDR If you need them, you'll know. But you mostly won't.
2 of 6
2
If I am expecting to have an object receive async calls, I tend to bind its methods. This makes it possible to say things like someWidget.addEventListner('change', myObject.handleChange); instead of someWidget.addEventListner( 'change' , event => myObject.handleChange(event) ); This code establishes a trampoline for starting a line of work that can be cancelled before it finishes, on the grounds that the input data on which the work is based are no longer valid. A trampoline, according to the protocols that I use, is an object that supports a defer(func, ...args) operation. This says that assuming that the work is continuing, func will be called with (...args) eventually and on a short stack. The simplest such defer would look like this: const defer = (func, ...args) => setTimeout(func, 0, ...args); This would meet the requirement that the function will be called eventually on the args and on a short stack, but it would not support a thread that could be canceled before it finishes and would not support a priority scheme, both of which I have implemented with my own trampoline code. Each of these, when I put them into effect, relies on setTimeout at the very bottom, however. Anyway, the implementation of the tramp for cancellability binds all the methods to the instance, in the .new method. This way, I never have to worry about using a method call like () => obj.method(...args) to cite them. I just name them, like obj.method and that suffices as a function to be called back, which is something that happens a lot when you are doing async stuff without relying on Promise.
🌐
Reddit
reddit.com › r/learnjavascript › .call vs .bind vs .apply...eli5?
r/learnjavascript on Reddit: .call vs .bind vs .apply...ELI5?
May 28, 2015 -

Hi,

Can I get somewhat of an ELI5 explaination of bind vs call vs apply?

I'm still confused as to what these 3 do.

Even in the context of having a simple add function would be great.

Thanks!

Top answer
1 of 2
16

call calls a function with individual arguments:

fn.call( thisArg, 1, 2, 3 );      // fn( 1, 2, 3 ); with `this` in fn set to `thisArg`

apply calls a function with an array of arguments:

fn.apply( thisArg, [ 1, 2, 3 ] ); // fn( 1, 2, 3 ); with `this` in fn set to `thisArg`

bind doesn't call the function at all, but binds scope and arguments to a function so that when you call the resulting function the original one is called:

var newFn = fn.bind( thisArg, 1, 2, 3 ); // fn doesn't run yet
newFn();    // calls fn.call( thisArg, 1, 2, 3 );
newFn( 4 ); // calls fn.call( thisArg, 1, 2, 3, 4 );

So call vs apply just comes down to how you have your data (well that and call is much faster). Use bind when you want to do something later

2 of 2
7

You should read each page on MDN in full:

Function.prototype.apply()
Function.prototype.call()
Function.prototype.bind()

call and apply do essentially the same thing: they let you call a function with complete control over its this value and its argument list. Normally when you invoke a function you do not get to control what this will be inside the function; that's determined by the shape of the expression on the left hand side of the function call operator (i.e. the parentheses). apply takes the argument list as an array or an array-like object, whereas call takes a series of arguments directly. apply is often used when you want to write a wrapper around another function, because you can pass the arguments variable for the array of arguments, which means the called function receives whatever arguments the wrapper function had.

bind performs partial application, i.e. it fixes or binds the this value and arguments of a function. It doesn't call the function, but returns a bound version of the function. For example:

var fixed = foo.bind(someObject);

fixed is now a version of the function foo that when called will have its this value set to someObject. fixed can also take arguments, which are passed on normally, e.g. fixed('str') calls foo('str') except inside foo, this is set to someObject instead of what it would normally be (in this case, the global object.) If any bound parameters were specified, they come before any given when the bound function is called.

🌐
Reddit
reddit.com › r/learnjavascript › i have never used bind, call, or apply in my front-end code. are these function methods primarily for back-end development?
r/learnjavascript on Reddit: I have never used bind, call, or apply in my front-end code. Are these function methods primarily for back-end development?
October 25, 2019 - Thanks for the breakdown, that's a great description of how bind works. ... Really insightful comment. Thanks. I have one question: ... Because if you add (), you're calling the function as opposed to referencing it.
🌐
Reddit
reddit.com › r/codehunter › javascript call() & apply() vs bind()?
r/codehunter on Reddit: Javascript call() & apply() vs bind()?
October 19, 2021 - The difference is with the way we send the arguments (manual vs array) ... var obj = { x: 81, getX: function() { return this.x; }};alert(obj.getX.bind(obj)());alert(obj.getX.call(obj));alert(obj.getX.apply(obj));
🌐
Reddit
reddit.com › r/learnjavascript › i never did wrap my head around apply(), call(), and bind()
r/learnjavascript on Reddit: I never did wrap my head around apply(), call(), and bind()
February 6, 2023 -

I know that they could be used to manipulate what the this keyword points to or means. but what I can't seem to get is their use cases and when exactly are they relevant.

Top answer
1 of 5
24
It could be confusing, yes. Especially with all the "fancy" guides circulating on the web. The apply() method allows you to call a function with a specified this value and arguments provided as an array. For example: let object1 = {name: "John Doe"}; let object2 = {name: "Jane Doe"}; function sayName() { console.log(this.name); } sayName.apply(object1); // Output: "John Doe" sayName.apply(object2); // Output: "Jane Doe" The call() method is similar to apply(), but instead of taking an array of arguments, it takes a list of arguments separated by commas. For example: let object1 = {name: "John Doe"}; let object2 = {name: "Jane Doe"}; function sayName(greeting) { console.log(greeting + " " + this.name); } sayName.call(object1, "Hello"); // Output: "Hello John Doe" sayName.call(object2, "Hi"); // Output: "Hi Jane Doe" The bind() method creates a new function with the specified this value and any arguments you want to permanently pass to the new function. For example: let object1 = {name: "John Doe"}; let object2 = {name: "Jane Doe"}; function sayName(greeting) { console.log(greeting + " " + this.name); } let sayJohnName = sayName.bind(object1, "Hello"); let sayJaneName = sayName.bind(object2, "Hi"); sayJohnName(); // Output: "Hello John Doe" sayJaneName(); // Output: "Hi Jane Doe" As of their usage, well... apply() and call() were used for implementing inheritance back in the day. Nowadays, they are probably used for function borrowing, e.g. You can use apply() or call() to reuse a function on another object, even if the function was not defined on that object. bind() is still used for cementing the context in event handlers.
2 of 5
17
They are ways to modify how a function's parameters are passed in, including the this parameter. They were always kind of technical and edge casey, but these days there are even fewer instances where you would use them. That said... call Allows you to call a function, specifying the this value as the first parameter rather than the thing to the left of the dot. So this: obj.myFunc('param'); Becomes this: myFunc.call(obj, 'param'); That's really it. The thing to the left of the dot becomes the first parameter, everything else moves to the right a spot. This is useful if you have something you want to explicitly set as the this for a function. These days though most JS devs code in such a way that uses this rarely if at all. apply Similar to call, but all of the non-this parameters get grouped into an array. So this: obj.myFunc('param1', 'param2'); Becomes this: myFunc.apply(obj, ['param1', 'param2']); This was typically used not so much to assign this, but when you had all of your parameters in a dynamic array. For example, if you had an array of numbers and wanted to find the largest number in an array: const nums = [1, 2, 3, 4]; Math.max.apply(null, nums); // 4 We set this to null because it doesn't actually get used and we don't care about it. Then we could pass an array of a hundred items in if we want. These days, we can use the spread operator to accomplish the same thing more simply: Math.max(...nums); bind The bind method is a little more interesting because it doesn't actually call anything immediately, but instead creates a new function with the passed parameters baked in (including this). So this: obj.myFunc('param'); Becomes this: const boundFn = myFunc.bind(obj, 'param'); boundFn(); This is similar to the partial function found in lodash and other libraries. It comes up occasionally that you want a function with a this or other parameters baked into it, for example, with an event listener: button.addEventListener('click', listener.onClick.bind(listener)); However, the same thing can be accomplished with an anonymous function, and most devs usually find that preferable. button.addEventListener('click', (event) => { listener.onClick(event); }); Real world example The last time I remember using these is in trying to solve the hasOwnProperty problem. Historically, there has been no good way to check if an object has a property in JavaScript. The in operator travels up the prototype chain in unexpected ways, and hasOwnProperty can be replaced in an object's prototype. You could use lodash's has , but I was not able to use lodash for this project. So I wrote this function: const has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); What does that do? You sort of have to read it in reverse. We take hasOwnProperty and bind it as the this for call. So every time this function is called, it will use call to call it, and whenever you use call to call a function, the first parameter is now the this for that call. In other words, this: has({ name: 'sue' }, 'name'); // true Hooray! Of course these days, you can just use Object.hasOwn , so yeah, not much point in these anymore.
🌐
Reddit
reddit.com › r/javascript › [askjs] call vs apply in modern javascript.
r/javascript on Reddit: [AskJS] Call vs Apply in modern javascript.
October 26, 2025 -

I know that historically .call() accepts arguments individually, and that .apply() accepts all arguments at the same time in an array. But after the spread operator was introduced is .apply() purely redundant? It seems like any code written like this

f.apply(thisObj, argArray)

could instead be written like this

f.call(thisObj, ...argArray)

and you would get the exact same result (except that the former might run slightly faster). So is there any time that you would be forced to use apply instead of call? Or does apply only exist in the modern day for historical reasons and slight performance increases in some cases?

Find elsewhere
🌐
Reddit
reddit.com › r/javascript › javascript’s .call() vs .apply() vs .bind()
r/javascript on Reddit: Javascript’s .call() vs .apply() vs .bind()
October 21, 2013 - Call = Coll = Collection = hf3 confirmed. ... This article completely misses the most important feature of bind: it lets you curry arguments!
🌐
Reddit
reddit.com › r/learnjavascript › call, apply, bind and function borrowing in javascript
r/learnjavascript on Reddit: call, apply, bind and function borrowing in JavaScript
June 29, 2022 - Sure. Its faster because it does less. But they have different use cases. If your arguments are well known, use call. If you have an arbitrary list of arguments, use apply. There'd be extra, unnecessary work involved if you had set of known ...
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"                                     
🌐
Reddit
reddit.com › r › programming › comments › 6c9n80 › javascript_bind_vs_apply_and_call
r/programming - JavaScript .bind() vs .apply() and .call()
May 20, 2017 - Will return window if called as foo() but an object initialized by foo if called as · f = new foo(); 3 · Reply · ShareReportSaveFollow · Continue this thread · level 2 · · 5 yr. ago · You don't use classes in Typescript? If you do, you have to type this every time you use a member of the class. And .bind(this) is very useful on things like click handlers, when passing in a method: class MyViewModel { private count = 0; public myClickHandler(event:MouseEvent){ this.count++; } public registerHandler(elem: HTMLElement){ elem.addEventListener('click', this.myClickHandler.bind(this); } } 2 ·
🌐
Educative
educative.io › answers › what-is-the-difference-between-call-apply-bind
What is the difference between call() apply() & bind() ?
The call method binds the this value to the function and executes the function. It takes the this value and a list of arguments as parameters.
🌐
Reddit
reddit.com › r/learnjavascript › what is the difference between call and bind
r/learnjavascript on Reddit: what is the difference between call and bind
September 13, 2024 -

so bascially there are two codes which return the same output

code -1

const person = {
    name: "John",
    greet: function() {
      setTimeout(function() {
        console.log(this.name);
      }.bind(this), 1000); // This will immediately invoke the function instead of waiting 1 second
    }
  };
  
  person.greet();

output - john

code -2

const person = {
    name: "John",
    greet: function() {
      setTimeout(function() {
        console.log(this.name);
      }.call(this), 1000); 
    }
  };
  
  person.greet();

output - john

now i know how call and bind works call attaches a new this context while bind does the same thing and creates a new function at the same time

chatgpt says they are different i sort of doubt it

here is the answer of chatgpt

You're right! It may work in some environments like the browser console or terminal, but the behavior is not ideal or recommended for use with `setTimeout`.

Let me explain why:

### When you use `call`:
In your code, using `call` within `setTimeout` does immediately invoke the function. The function gets executed before the `setTimeout` delay even starts, which means it’s not truly being delayed. However, depending on the environment, you may still see the expected behavior because the execution of the `setTimeout` handler itself could be deferred just enough to make it appear as though it worked correctly.

Here's why it shouldn't be used:
1. **Immediate Execution**: `call` immediately calls the function, passing its result to `setTimeout`. So, the function is run immediately, and the delayed execution via `setTimeout` is bypassed.
2. **Expected Behavior**: Using `bind` is more appropriate because it creates a new function that maintains the proper `this` context and will be executed after the delay.

### Example with `call`:
```javascript
const person = {
  name: "John",
  greet: function() {
    setTimeout(function() {
      console.log(this.name); // Will immediately log "John"
    }.call(this), 1000); // Function is invoked immediately
  }
};

person.greet();
```

Even though the `call` might seem to work in your environment, you won't get the 1-second delay. It will execute instantly because `call` runs the function immediately. You’re essentially passing `undefined` to `setTimeout`.

### Example with `bind` (correct):
```javascript
const person = {
  name: "John",
  greet: function() {
    setTimeout(function() {
      console.log(this.name); // `this` will now correctly refer to `person`
    }.bind(this), 1000); // Function is bound but not invoked immediately
  }
};

person.greet();
```

Using `bind` ensures that `this` refers to `person`, and the function is called after the 1-second delay.

### Conclusion:
While it may appear to work in some environments due to execution timing differences, `call` is not the correct method for use with `setTimeout` in this scenario. The correct approach is to use `bind`, which delays execution while maintaining the correct context for `this`.

now i kind of doubt whether chatgpt is right or not
so good people of learnjavascript plz clear it out for me

edit : "chatgpt has made me addicted to quick answers. thats why instead of going through docs i came straight here

as some one pointed here testing it or just reading the docs could have solved this question .

i am breaking this habit right now thanks everyone here for being patient with me and calling out my errors "

🌐
Reddit
reddit.com › r/reactjs › why is it more performant to use bind instead of an arrow function to call another arrow function?
r/reactjs on Reddit: Why is it more performant to use bind instead of an arrow function to call another arrow function?
January 28, 2024 -
<Box
onClick={toggleBox.bind(null, index)}>
</Box>    

I heard it's because you don't re-create the function if you do this inside onClick, but since you're also re-creating the arrow function toggleBox on each render, what should you do to ensure the best performance? Should you use useCallback and then use toggleBox.bind(null, index) inside onClick?

🌐
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.
🌐
Reddit
reddit.com › r/webdev › do we really use object-oriented concepts of javascript like call, bind, apply, prototype, etc in day-to-day life in websites that use frameworks such as react and vue ?
r/webdev on Reddit: Do we really use object-oriented concepts of javascript like call, bind, apply, prototype, etc in day-to-day life in websites that use frameworks such as React and Vue ?
February 13, 2022 -

I am giving interviews for the frontend position and in every interview, they seem to just ask about all these concepts. I work currently in an eCommerce company, we use Vue js as the framework but in my 2 yrs of experience I have never used object-oriented concepts of javascript, rather we use functional programming. Is object-oriented programming javascript really used everywhere or these are some generic questions that are being asked in interviews?
edit: call apply bind were example for interview questions, i meant advanced concepts like prototype inheritance and all

🌐
Reddit
reddit.com › r › learnjavascript › comments › q8vgrp › trying_to_understand_bind_vs_call
r/learnjavascript - Trying to understand Bind vs Call
October 15, 2021 -

Hi! I'm trying to understand Bind vs Call. I do know that Call will execute a function where you can reference an object so .this refers to who calls, and also add arguments, just like Apply with the difference of an array being passed.

I'm trying to understand Bind though. From what I've gathered it is used to store the returned function for later use? I've seen the button examples, and even timeout examples but I don't see the difference in result.

const person = {
name: "John Doe"
};

function getName() {
return this.name;
}

const myFunCall = getName.call(person);


setTimeout(function(){alert(myFunCall);}, 2000);

Gives me the same result when using bind:

const person = {
name: "John Doe"
};

function getName() {
return this.name;
}

const myFunBind = getName.bind(person);


setTimeout(function(){alert(myFunBind());}, 2000);
Top answer
1 of 2
6

From what I've gathered it is used to store the returned function for later use?

Right. So call() calls a function right away. bind() on the other hand is a kind of call(), but it doesn't call the function right away. It takes all the arguments you passed into it, and holds on to them, returning a function that when called, effectively uses call() with those arguments. Think of bind() as:

function bind(func, ...callArguments) {    function callFuncWithCall() {        return func.call(...callArguments)    }    return callFuncWithCall}

So its a call() for later.

You can also think of call as:

func.bind(...args)() // calls bind, then calls the return of bind

In your example you're not seeing a difference because you're doing the same thing, one the call way and one the bind way. The difference is in your alert:

alert(myFunCall);// vsalert(myFunBind());

Notice the difference? In the call version you're alerting the value. In the bind version you're calling the value. myFunCall is the return value of getName() whereas myFunBind is a version of the function getName() you have to call to get a value.

2 of 2
1

They clearly dont give you the same result.

the bind returns a new function where the object you provided is bound to the function to replace any reference of “this” inside the function.

The call is doing the same as bind but it actually also goes ahead and calls the function.

bind:

takes a object to be used as the “this” and optionally any arguments this function use and returns a new function with the “this” and any argument already replaced with the values you provide.

function A(x) { return this.y + x; }

const a = A.bind({y: 30}); const b = A.bind({y: 30}, 7);

a(5) // returns 35 b() // returns 37

call:

Does everything bind does but goes one step further and calls that function immediately.

A.call({y: 30}, 5); // returns 35 A.call({y: 30}, 7); // returns 37

apply:

Does the same as call but takes the function arguments as array instead of comma separated.

A.call({y: 30}, [5]); // returns 35 A.call({y: 30}, [7]); // returns 37

🌐
DEV Community
dev.to › hebashakeel › difference-between-call-apply-and-bind-4p98
Difference between call,apply and bind - DEV Community
May 7, 2022 - Call and apply are pretty interchangeable. Both execute the current function immediately. You need to decide whether it’s easier to send in an array or a comma separated list of arguments.
🌐
CodeSweetly
codesweetly.com › call-apply-bind-javascript
call() vs apply() vs bind() in JavaScript | CodeSweetly
call(), apply(), and bind() make it possible for you to change the runtime binding of a function's this keyword from one object to another.