最后一个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 }
点赞 评论

相关推荐

03-06 18:20
门头沟学院 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务