function antiShake(func, delay){
var timer = null;
return function(...argus){
var _this = this
clearTimeout(timer);
timer = setTimeout(function(){
func.apply(_this, argus);
}, delay);
}
}
原文:https://www.cnblogs.com/cupid10/p/13282456.html