function debounce(fn, delay) {var timerreturn function () {var context = thisvar args = arguments
clearTimeout(timer)timer = setTimeout(function () {
fn.apply(context, args)
}, delay)}}代碼如上 不明白這里為什么一定要 return function 加一層是干什么用的求解
關(guān)于的debounce原理
有只小跳蛙
2018-08-10 17:21:31