我的问题是我不明白这里称为“objectchanger”的方法是如何工作的
function test()
{
this.value=5;
}
test.prototype.Add=function()
{
this.value++;
};
var obj = new test();
obj.Add();
alert(obj.value);
function objectchanger(fnc, obj)
{
fnc.call(obj);
//obj.fnc(); >> without this line of code it works fine but why?????
//why i don't need to write this code --
}
objectchanger(obj.Add, obj);
alert(obj.value); // the value is now 7