Skip to content

Function Method Reference

Calls the function with the provided args as an array. Useful when arguments need to be dynamically generated.

fn function(arg1, arg2) {
return [arg1, arg2];
}
var arr = function.apply([1, 2]); // [1, 2]

args: [dyn!] - The arguments of the original function in an array.

dyn! - The value of the original function.

Calls the function with the provided args. Useful when calling a nullish value.

fn function(arg1, arg2) {
return [arg1, arg2];
}
var arr = function.call(1, 2); // [1, 2]

call is called with the same arguments as the original function.

dyn! - The value of the original function.