properties inside the function: arguments and this are two special objects inside the function arguments:function recursion (num) {if (num<=1) {return 1; }else{return num*recursion (num-1); }} Another notation: function recursion (num) {if (num<=1) { return 1; }else{return Num*arguments.callee (num-1); }}arguments: An array representing the current parameter Arguments.callee represents the function that is currently being executed. Or a reference to a function called Arguments.callee, Arguments.callee gives the anonymous function a way to self-reference var func=function () {Alert (func===arguments.callee);}func ();//Call this function, we get the result is true from this example we can see that the Func and Arguments.callee object both the type and the value are equal. The initial value of the Callee property is the function object being executed caller: Returns a reference to the current function called the This object: the This object refers to window (Windwo is an object, and is the largest object in JS. , and it is the outermost object) alert (window);//[object window] alert (typeof window);//object window is the object type is the object that represents the global alert (t His); [Object Window] This is currently the window, because the window is in the range of alert (typeof this);//object alert (This===window);//return value istrue under the "global" variable this is the window Window.color= ' red '; function Saycolor () {//alert (this);//[Object window] Alert (this.color);//Because the function Saycolor () is not assigned to an object so here This still represents the Window object} saycolor ();//Call the Color var box under Window={ color: ' Blue '}; Box.saycolor=saycolor; Assigns the Saycolor function to theThe Saycolor property of the Box object/* Top code is actually equivalent to the Var box={ color: ' Blue ', saycolor:function () {//alert (this);//[Object Object] Alert (this . color); } }; */Box.saycolor ()///This is performed in box This.color//The result is blue--------------------------------------------<script type< /c6>= "Text/javascript">function box (num1,num2) {return num1+num2;} You can use this method to convert the SUM function to the box method function sum (num1,num2) {return box.apply (this,[num1,num2]);//This refers to the Window object ( This is the same as for window), the array represents the passed parameter}alert (sum (19,21));//The result returned is 40-> function apply: syntax: Apply[[thisobj],[argarray]] Definition: A method of applying an object that replaces the current object with an object thisobj represents an object in the above example, this object is the current object this argarray represents an array of parameters used to replace the object of the current object. The other notation function sum2 ( NUM1,NUM2) {return box.apply (this,arguments),//arguments represents an array of parameters in the box function}alert (sum2 (10,10)); Use apply and call to impersonate another method the effect of apply is the same as the call implementation. Call and apply are different if the arguments in call are one, and apply must pass function sum in the form of an array (num1,nu m2) {return box.call (this,num1,num2);//Note the way the parameter is passed and the difference between apply} alert (sum (10,10)); Impersonation function: Mainly used to extend function to run the scope/* var color= ' red '; var box={color: ' Blue '}; function Saycolor () {alert (this.color); }//Use Call to impersonate the Window object Saycolor.call (window);//red pops up the Window object's color Saycolor.call (this);//Red Popup Style Window object Color//Use call to impersonate a box object Saycolor.call(box);//blue pops up the Color property under the Box object * * You can see that the Saycolor Property object is not added to the box object but can perform a saycolor effect view code