3.1.0 • Published 5 years ago

calculatte v3.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

实现算法 n秒打印n

    let num=(time,val)=>{
        return new Promise(resolve,reject)=>{
            setTimeout(()=>{
                console.log(val);
                resolve();
            },time)
        }
    }
    num(1000,'1').then(()=>{
        num(2000,'2')
    }).then(()=>{
        num(3000,'3')
    }).then(()=>{
        num(4000,'4')
    }).then(()=>{
        num(5000,'5')
    })
3.1.0

5 years ago

3.0.0

5 years ago

1.0.0

5 years ago