Calling a Function Using function.apply
Syntax
apply(thisArg) apply(thisArg, argsArray)
Parameters
thisArg
-
The value of
this
provided for the call tofunc
. 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. argsArray
Optional-
An array-like object, specifying the arguments with which
func
should be called, ornull
orundefined
if no arguments should be provided to the function.
Return value
The result of calling the function with the specified this
value and arguments.