//不了解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);
});