只用log函数,是不能定义新的函数,还是不能改log代码,能改一下log代码就容易 const log = (callback) => { log.count = log.count || 0; if (log.count > 100) return; var count = log.count++; setTimeout(() => { console.log(count) callback && callback(callback) }, Math.random() * 1000 % 10) } log(log)