Save Async/Await response on a variable
1) Return something from your asyncExample function const asyncExample = async () => { const result = await axios(users) return result } 2) Call that function and handle its returned Promise: ;(async () => { const users = await asyncExample() console.log(users) })() Here’s why should you handle it like this: You can’t do top-level await … Read more