SOURCE

function mysleep(func,time){
    return function(){
        console.log(func,time,"ccc")
        setTimeout(()=>{
            func();
        },time);
    }
}

function a(){
    console.log('sleep')
}

let s = mysleep(a,1000)
s()
console 命令行工具 X clear

                    
>
console