Standard built-ins
Function.prototype.call()
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
| Name | Type | Description |
|---|---|---|
| thisArg | Any | Receiver supplied to target; the target controls this handling. |
| args | Any[] | 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));