Why Promise.all cannot work after all asynchronous function are completed? <p>Hi I'm new to Js and I'd like to wait some async functions complete before print <code>ni</code>. But the code never print it I cannot understand why. Please help me:(</p> <pre><code>// public function this.run = function() { 'use strict'; let compile_lib = lib_array.map((item) =&gt; { return new Promise(() =&gt; {compileEntry(item);}) }); Promise.all(compile_lib).then(() =&gt; { console.log("ni"); }); } </code></pre>