Why await only works in async function in javascript?
Code becomes asynchronous on await – we wouldn’t know what to return What await does in addition to waiting for the promise to resolve is that it immediately returns the code execution to the caller. All code inside the function after await is asynchronous. async is syntatic sugar for returning a promise. If you don’t … Read more