function text1(){
return new Promise((resolve, reject) => {
setTimeout(function () {
resolve(console.log(‘1111111111‘));//返回写函数里面你要执行的内容
},3000)
})
}
function text2(){
setTimeout(function () {
console.log(‘22222‘);//返回写函数里面你要执行的内容
},1000)
}
function timeFN(){
text1().then(() => {
text2()
})
}
timeFN()
更多参考链接:https://blog.csdn.net/weixin_43023873/article/details/91538556
原文:https://www.cnblogs.com/520BigBear/p/12450027.html