function repeact(str, time, print) { return function (s) { for (let i = 0; i < time; i++) { setTimeout(() => { str(s); }, print * (i + 1)); } }; } const repeatFunc = repeact(console.log, 4, 3000); repeatFunc("helloword");
5 3

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务