Promise例子
摘要:
let p = new Promise((resolve,reject)=>{ setTimeout(()=>{ let n=rand(1,100); if(n<=30){ resolve(n);//将Promise设为 成功 }else{ reject(n);//将Promise设为 失败 } } 阅读全文
posted @ 2022-07-01 15:07 anjun_xf 阅读(53) 评论(0) 推荐(0) 编辑