export function throttle(callback, timeout) { let startTime = 0; return (...args) => { let nowTime = Date.now(); // 第一次会执行,后面 startTime = nowTime if(nowTime - startTime >= timeout) { callback.call(this, ...args); startTime = nowTime; } }}