这里是我的程序。
function asyncFunction() {
return new Promise(function (resolve, reject) {
setTimeout(function () {
resolve('Async Hello world');
}, 0);
});
}
asyncFunction().then(function (value) {
console.log(value);
}).catch(function (error) {
console.log(error);
});
setTimeout(function() {
console.log('1----->');
}, 0);
请教一下大家,第二行中的Promise的对象函数是什么时候执行的。下面是运行结果
梵蒂冈之花
相关分类