function a(fun, t){ let last = 0 retrun () => { let now = +new Date() if(now - last > t){ fun.apply(this, arguments) last = now } }}function b(fun, lay) { let t = null return () => { clearTimeout(t) t = setTimeout(() => { fun.apply(this, arguments) }, lay) }}var c = (fn, ...a) => (...b) => fn(...a, ...b)对于前两个方法,主要作用就是改变this的指向,但是使用场景有什么不一样吗?想不到应该在怎样的场景下使用;对于第三个方法,我的的理解它的使用方法就是:c(fn, {a:a})({b:b}),但是也想不出来有怎样的使用场景
添加回答
举报
0/150
提交
取消
