Concept Flow - Async function syntax
Call async function
Function starts running
Encounter await?
No→Run next line
Yes
Pause function, wait for Promise
Promise resolves
Resume function after await
Return value wrapped in Promise
Caller can use .then or await
This flow shows how an async function runs, pauses at await to wait for a Promise, then resumes and returns a Promise.