function baz (fn,obj) {
return function(){
return fn.apply(obj,arguments);
}
}
function foo(){
console.log(this.a);
}
var a = 3;
var obj = {
a:5
}
var bar = baz(foo,obj);
var b = bar();
console.log(b);
之前this指向window,輸出結果為3,用了bind後,輸出結果為5