Node.js - Async.js: how does parallel execution work?
问题 I want to know how parallel execution works in async.js async = require('async') async.parallel([ function(callback){ for (var i = 0; i < 1000000000; i++) /* Do nothing */; console.log("function: 1") }, function(callback){ console.log("function: 2") } ]); In the above example, I expect obtain the output: function: 2 function: 1 but, the console throws the inverse, what is happening? thanks. 回答1: You get the answer you don't expect because async launches function: 1 first and it doesn't