Standard built-ins

Function.prototype.call()

Try the free JavaScript compiler

Immediately invokes the callable with the supplied this and individual arguments. A strict ordinary function preserves the supplied value; arrows ignore it.

Formal Syntax & Structure

javascript syntaxjavascript
fn.call(thisArg, ...args)

Parameters & Attributes

NameTypeDescription
thisArgAnyReceiver supplied to target; the target controls this handling.
argsAny[]Positional arguments.

Return Value

Any

Target return value.

Working Example

Example Snippetjavascript
function f(x){return this.n+x;} console.log(f.call({n:3},4));
JavaScript Reference