I am new to JS and was learning async await. So, what I cannot get is that why async function returns promise. Here is the sample code which returns data wrapped inside promise but why inside promise javascript
class Ajax {
async getPost(url) {
const header = await fetch(url);
const data = await header.json();
return data;
}
}