A function is a type of object, and a function name is a pointer to an object
function as a parameter pass
var box=function(A, b ) {return a (b.);} function A (b) { return b+10;} Alert (Box (A,3));
Arguments.callee calls itself
function box (num) { if(num<=1) { return 1; } Else { return Num*arguments.callee (num-1); }} document.write (Box (10));
This represents the scope object where the function is located, and if it is inside the object, it represents the object
Globally, this represents the window
var box={ name:"Tian Wei", func:function() { return This . Name;} } document.write (Box.func ());//Tian Wei
The prototype object of the function prototype has 2 methods call (), replay ();
function Box (b) { return a +b;} function sum (c,d) { return box.apply (this, [c,d]);
Return box.apply (this,arguments);} document.write (sum (3,4));
Posing as box,this means box under window
function Box (b) { return a +b;} function sum (c,d) { return box.call (this, c,d);} document.write (sum (3,555));
Call Object impersonating
var color= "Blue"; var box={ color:"Red"}function showcolor () { return This . Color; document.write (Showcolor.call (box));
Basic knowledge of JS function