从docs我了解到.proxy()
会改变作为参数传递的函数的作用域。有没有人能给我解释清楚?我们为什么要这样做呢?
发布于 2013-11-18 15:14:53
我写了这个函数:
function my_proxy (func,obj)
{
if (typeof(func)!="function")
return;
// If obj is empty or another set another object
if (!obj) obj=this;
return function () { return func.apply(obj,arguments); }
}
https://stackoverflow.com/questions/4986329
复制相似问题