Prefer async/await over promises or callbacks
Prefer async/await over promises or callbacks.
✅ Reads top down
✅ Typically more concise
✅ The func signature clearly says "I return a promise" (since async keyword is required)
✅ Can handle errors via try/catch
✅ Enforces func always returns a promise, so you can't forget
Here's an example of why async/await is less error prone.
With the async keyword, the function automatically returns a promise. So even though I'm returning a plain string below, the actual return type will be a promise that resolves to the string. 👍
