I need to do the code like following:
function taskFirst(k, v) { console.log(k, v); } function taskSecond(k, v) { console.log(k, v); } function run() {
It can be as follows
function taskFirst(k, v) { console.log(k, v); } function taskSecond(k, v) { console.log(k, v); } async.series([ function(callback) { callback(null, taskFirst(g1, g2)); }, function(callback) { callback(null, taskFirst(g3, g4)); } ],function(error, result){ });