//不了解promise可以先去看看,了解后再来相信大家读能看的懂
function Promise1(resolve, reject) {
setTimeout(function() {
resolve('1');
},5000);
}

function Promise2(resolve, reject) {
setTimeout(function() {
resolve('2');
},5000);
}

function Promise3(resolve) {
setTimeout(function() {
resolve('3');
},5000);
}
new Promise(Promise1).then(function(val){
console.log(val);
return new Promise(Promise2);
}).then(function(val){
console.log(val);
return new Promise(Promise3);
}).then(function(val){
console.log(val);
});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案