Call
Each func will inherit call apply and other methods.
function print (mesage)
{
console.log (mesage);
return mesage;
}
Call (Thisagr,agr1,agr2 ...), the first pass of a context. The number of arguments is followed.
Apply
Apply (THISAGR,[AGR1,AGR2]), the Apply method is the same as call usage, except that the parameters passed are different.
function print (a,b)
{
Console.log (a + b);
}
Bind
Bind is to bind a function to a touch object.
<script>
function f (y) {alert (this.x + y);}
var o = {x:};
var g= f.bind (o);
g ();//
Summary
Calls to the Apply function are the same as direct use of function calls.
Call apply can also mimic the bind method.
<script>
function f (y) {alert (this.x + y);}
var o = {x:};
F.call (o,);//
f.apply (o, []);
The above is a small set to the introduction of JavaScript must Know (10) call apply bind the relevant knowledge of the use of the instructions, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!