首页 > 其他 > 详细

setTimeout Promise

时间:2020-02-12 22:57:48      阅读:69      评论:0      收藏:0      [点我收藏+]
 setTimeout(function() {
        console.log("1")
        setTimeout(function() {
            console.log(‘2‘)
            setTimeout(function() {
                console.log(‘3‘)
                setTimeout(function() {
                    console.log(‘4‘)
                }, 1000)
            }, 1000)
        }, 1000)
    }, 1000)
function f1() {
        return new Promise(function(resolve, rejext) {
            setTimeout(function() {
                resolve(‘1‘)
            }, 1000)
        })
    }

    function f2() {
        return new Promise(function(resolve, rejext) {
            setTimeout(function() {
                resolve(‘2‘)
            }, 1000)
        })
    }

    function f3() {
        return new Promise(function(resolve, rejext) {
            setTimeout(function() {
                resolve(‘3‘)
            }, 1000)
        })
    }

    function f4() {
        return new Promise(function(resolve, rejext) {
            setTimeout(function() {
                resolve(‘4‘)
            }, 1000)
        })
    }

 

setTimeout Promise

原文:https://www.cnblogs.com/yangke0017/p/12301364.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!