RT 因為匿名函數中this指針本來就指向window不明白 如果只是想通過通過apply傳遞args參數列表完全可以寫成fn.apply(window, args); 此舉有何意義fn.apply(context, args); let timer = null; return function() { let context = this; let args = arguments; clearTimeout(timer); timer = setTimeout(function() { fn.apply(context, args); }, delay); }}
js 仿抖動函數為什么要存起this并在執行時為回調綁定作用域
胡子哥哥
2019-03-01 10:11:35