You don’t need to put all the code in one function!
A function should perform only one task assigned to it and return a value. Therefore, asynchronous tasks should be placed in separate functions.
JavaScript itself is not asynchronous, and the async/await keywords simply inform the interpreter that the result of this code will be obtained later. (Read about the Event Loop).
If you call an asynchronous function without await, the code will continue to execute without waiting for it to finish. Await tells the interpreter to wait for the completion of this function