Call apply bind acts similarly. That is, one method of calling an object, replacing the current object with another object.
Pager
Syntax: Call ([thisobj[,arg1[, arg2[, [,. ArgN]]])
Apply
Syntax: Apply ([Thisobj[,argarray]])
Bind
Call () apply () is immediately called the corresponding function, and bind () does not, bind () will generate a new function, the bind () function parameter is consistent with call (), the first parameter is a bound object, and then accept the variable arguments passed to the function. When the new function generated by bind () returns, it is time to tune
var m = {
"X": 1
};
function foo (y) {
Alert (this.x + y);
}
Foo.apply (M, [5]);
Foo.call (M, 5);
var foo1 = Foo.bind (M, 5);
Foo1 ();
Caller
When a function calls another function, the called function automatically generates a caller property that points to the function object that called it. If the function is not currently called, or is not called by another function, caller is null.
callee
When a function is called, its Arguments.callee object points to itself, which is a reference to itself.
Because arguments is valid when a function is called, Arguments.callee does not exist when the function is not called (that is, Null.callee), and referencing it produces an exception.
arguments: When a function is called, a hidden object named arguments is automatically generated inside the function. The object is similar to an array, but not an array, but an object. You can use [] to get the arguments that are passed when the function is called.
JS call Apply caller callee bind