RammusXu / rammusxu.github.io

My profile
https://rammusxu.github.io/
2 stars 0 forks source link

Nodejs - async #24

Closed RammusXu closed 8 years ago

RammusXu commented 8 years ago
async.series({
        one: function(callback) {
            callback(null, 1);
        },
        two: function(callback) {
            callback("error", 2);
        }
    },
    // 如果不放err, 會印不出所有results
    function(err, results) {
        if (err) {
            console.log("err", err)
        }
        console.log(results);
    });