The call() method calls the function with a given this value and arguments provided individually.

Try it


call(thisArg, arg1)
call(thisArg, arg1, /* …, */ argN)



The value to use as this when calling func. If the function is not in strict mode, null and undefined will be replaced with the global object, and primitive values will be converted to objects.

arg1, …, argN Optional

Arguments for the function.

Return value

The result of calling the function with the specified this value and arguments.


Note: This function is almost identical to apply(), except that call() accepts an argument list, while apply() accepts a single array of arguments — for example, func.apply(this, ['eat', 'bananas']) vs., 'eat', 'bananas').

Normally, when calling a function, the value of this inside the function is the object that the function was accessed on. With call(), you can assign an arbitrary value as this when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions.

Warning: Do not use call() to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means is undefined, and classes throw an error because they can't be called without new. Use Reflect.construct() or extends instead.


Using call() to invoke a function and specifying the this value

In the example below, when we call greet, the value of this will be bound to object obj, even when greet is not a method of obj.

function greet() {
  console.log(this.animal, "typically sleep between", this.sleepDuration);

const obj = {
  animal: "cats",
  sleepDuration: "12 and 16 hours",
};; // cats typically sleep between 12 and 16 hours

Using call() to invoke a function without specifying the first argument

If the first thisArg parameter is omitted, it defaults to undefined. In non-strict mode, the this value is then substituted with globalThis (which is akin to the global object).

globalThis.globProp = "Wisen";

function display() {
  console.log(`globProp value is ${this.globProp}`);
}; // Logs "globProp value is Wisen"

In strict mode, the value of this is not substituted, so it stays as undefined.

"use strict";

globalThis.globProp = "Wisen";

function display() {
  console.log(`globProp value is ${this.globProp}`);
}; // throws TypeError: Cannot read the property of 'globProp' of undefined

Transforming methods to utility functions

call() is almost equivalent to a normal function call, except that this is passed as a normal parameter instead of as the value that the function was accessed on. This is similar to how general-purpose utility functions work: instead of calling, you use map(array, callback), which avoids mutating Array.prototype, and allows you to use map with array-like objects that are not arrays (for example, arguments).

Take Array.prototype.slice(), for example, which you want to use for converting an array-like object to a real array. You could create a shortcut like this:

const slice = Array.prototype.slice;

// ...;

Note that you can't save and call it as a plain function, because the call() method also reads its this value, which is the function it should call. In this case, you can use bind() to bind the value of this for call(). In the following piece of code, slice() is a bound version of, with the this value bound to Array.prototype.slice(). This means that additional call() calls can be eliminated:

// Same as "slice" in the previous example
const unboundSlice = Array.prototype.slice;
const slice =;

// ...



ECMAScript Language Specification

Browser compatibility

BCD tables only load in the browser

See also