async function test() { (async () => { var a = await this.test1(); var b = await this.test2(a); var c = await this.test3(b); this.doThis(a,b,c); })(); } What does it mean to put methods (test1,test2,test3) inside async () => {})()? I find it faster than
async function test() { var a = await this.test1(); var b = await this.test2(a); var c = await this.test3(b); this.doThis(a,b,c); } Any downside of using it?
return Promise.resolve();in the first case, which isn't useful at all.(async () => { })();?async/awaitsyntax. If that expression exists within another function, it means the caller of that function will not be able to know when the asynchronous calls have completed.