Using function.call to Call a Function

Syntax

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


Parameters

thisArg

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.