最后一个js题直接用闭包就好了
function repeat(func, times, wait) {
var run = function() {
let currentTime = 0
let content = arguments[0]
return (function next() {
setTimeout(() => {
func(content)
currentTime++
if (currentTime < times) {
next()
}
}, wait)
})()
}
return run
}