We can only await for an actual result from a promise within an async function, while the async function itself will always return a promise. For example:
const demo = async () => {
const response = await Axios.get("http://example.com")
//"response" will contain the actual JS object
}
const p = demo()
// "p" will contain a pending promise, NOT the actual data
We can only await for an actual result from a promise within an async function, while the async function itself will always return a promise. For example: