First, the function is a pointer to a function object, and the name of the functions is a pointers to functions. Then in the function body, there will be a scope, that is the this keyword. The this keyword refers to the scope of the function run, for example, <script type= "Text/javascript" > function Funca () { alert (this); alert ("Function A "); }</script> the function Funca in the above code is defined in the global environment, then this is the Window object in the function body. Below the instructions for call and apply. Taking the call function as an example, the first parameter of call is to change the scope of the function, and the parameters to be passed to the function must be the same as the parameters of the original function, for example: copy code <script type= "Text/javascript" > var TestO = {name: "Lily"}; function Funca (A, b) {   ; alert (this); alert ("Function A"); } function FUNCB (A, b) { Funca.call (test O, A, b); } FUNCB; //this becomes testo&.nbsp </script> Copy Code we defined the FUNCB function, called the call function of Funca, and this time we changed the direction of this in Funca, which was originally pointed to the window, Now point to call's first parameter, the Testo object. and call, because the Funca function has two parameters, so if you want to Funca pass parameters, you must one by one to indicate the parameters, that is, two parameters A and B, or you can wear only the first parameter that is: Funca.call (TestO); namely: Funca.call (Testo,a); and the difference between apply and call only is that the second argument of apply can be an array form, and do not have to one by one to indicate the parameters, Funca.apply (Testo,[a,b]) introduced the basic usage of call and apply, it is important to say that the real use of his brother, the expansion function depends on the scope of the operation.
The application method of function in JS and the call method understand