make this:
/*this can't run*/
var o = {first:1};
function f(arg,o){
/*
can i do something make this function's this=o
*/
alert(arg+this.first);
}
f(2,o);
equal this:
var o = {
first:1,
f:function(arg){
alert(arg+first);
}
}
o.f(2);
and I know we can use this:
f.apply(o,1);
but I want to handle all things in f:
function f(arg,o){
/*magic*/
alert(arg+this.first);
}