苏幕遮零

好好学习,天天向上!

导航

Node.js 使用回调函数实现串行流程控制

下面是一个使用Node.js回调函数实现串行流程控制的示例:

setTimeout(function() {
    console.log('I excute first.');
    setTimeout(function() {
        console.log('I excute next.');
        setTimeout(function() {
            console.log('I excute last.');
        }, 100);
    }, 500);
}, 1000);

 

posted on 2017-09-02 17:22  苏幕遮零  阅读(211)  评论(0编辑  收藏  举报