How is async/await working in serial and parallel?
问题 I have two async functions. Both of them are waiting for two 3 seconds function calls. But the second one is faster than the first. I think the faster one is running in parallel and other in serial. Is my assumption correct? If yes, why is this happening as both the functions look logically same? function sleep() { return new Promise(resolve => { setTimeout(resolve, 3000); }); } async function serial() { await sleep(); await sleep(); } async function parallel() { var a = sleep(); var b =