0
点赞
收藏
分享

微信扫一扫

delay(console.log, 3, 1000)(‘hello’)

Go_Viola 2022-01-30 阅读 241


delay(console.log, 3, 1000)(‘hello’)

function delay(fn,nums,times){
return async function(content){
for(let i = 0 ; i<nums;i++){
await new Promise(resolve=>{
setTimeout(()=>{
fn.call(this,conent)
resolve()
},times)
})
}
}
}
delay(console.log, 3, 4000)('hello')



举报

相关推荐

0 条评论