用setTimeout实现setInterval
const _setInterval = (fn, misc) => {
const interval = () => {
setTimeout(interval, misc);
fn();
};
setTimeout(interval, misc);
};
const _setInterval = (fn, misc) => {
const interval = () => {
setTimeout(interval, misc);
fn();
};
setTimeout(interval, misc);
};
相关推荐