执行proxy函数,为什么会执行拦截的apply呢
var twice = {
apply (target, ctx, args) {
return Reflect.apply(...arguments) * 2;
}
};
function sum (left, right) {
return left + right;
};
var proxy = new Proxy(sum, twice);
//执行proxy函数,为什么会执行拦截的apply呢
proxy(1, 2) // 6
apply 不就是用来拦截函数调用的吗?
https://developer.mozilla.org...