var XW = {
Name: "Xiao Wang",
Gender: "Male",
Age:24,
Say:function (Sch, June) {
Console.log (arguments);
Console.log (THIS.name + "," + This.gender + ", this year" + this.age);
}
};
var xh = {
Name: "Little Red",
Gender: "Female",
Age:18
};
Xw.say ();
Xw.say.call (XH, "Xiaoxue", "1nianjia");
Xw.say.apply (XH, ["Xiaoxue", "1nianjia"]);
Xw.say.bind (XH);
G ("Xiaoxue", "1nianjia")
Xw.say.bind (XH, "Xiaoxue", "1nianjia") ();
Xw.say.bind (XH) ("Xiaoxue", "1nianjia");
The arguments that apply to pass are arrays, such as arguments.
If you pass the arguments by call, then it is the first parameter of the other method in the other way, and in both cases it depends on how you choose it.
Bind returns a function, and this in this function points to the first argument
Function Show (A, b) {
Alert (' this-> ' +this+ ' \ n ' +
' a-> ' +a+ ' \ n ' +
' B-> ' +b
);
}
var a=show.bind (12,2,5);
A ();
Call, apply, bind parsing