缺点是不能完全封装
switch=true
execTime:number
throttle(fn,interval){
if(new Date().getTime()-this.execTime>interval){this.switch=true}
if(this.switch){
fn();
this.switch=false;
this.execTime=new Date().getTime();
}
}
发表回复