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 callingfunc
. If the function is not in strict mode,null
andundefined
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.