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')