标签: javascript promise es6-promise
我的代码:
let promise = new Promise(function(resolve, reject){ console.log('p'); resolve(); }); promise.then(()=>console.log('r')); console.log('hi'); console.log('hi');
输出:
p hi hi r
我认为履行处理程序在console.log('hi');之前添加到队列中。看来我错了。任何提示?感谢
console.log('hi');