在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
let promise = new Promise(function(resolve,reject){ console.log("Promise create"); resolve(); }); promise.then(function(){ console.log('resolved.'); }); console.log("Hi!"); //Promise create //Hi! //resolved.
function timeout(ms:number) { return new Promise((resolve, reject) => { setTimeout(resolve, ms, 'done'); }); } timeout(1000).then((value) => { console.log(value); });
|
请发表评论