calculatte
v3.1.0
Published
```js let num=(time,val)=>{ return new Promise(resolve,reject)=>{ setTimeout(()=>{ console.log(val); resolve(); },time) } } num(1000,'1').then(()=>{ num(
Downloads
8
Readme
实现算法 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')
})