有人可以帮助我理解这两行代码并改进它们实际上允许我停止重复吗?
var wait = ms => new Promise(r => setTimeout(r, ms));
var repeat = (ms, func) => new Promise(r => (setInterval(func, ms), wait(ms).then(r)));
repeat(1000, () => Promise.all([myfunction()])
.then(...)
Run Code Online (Sandbox Code Playgroud)