async function fetchFact() { const res = await ( await fetch(`https://numbers-api.vercel.app/${numberInput.value}`) ).text(); alert(res); } code example
Example: async function fetchJson
async function getUserAsync(name)
{
let response = await fetch(`https://api.github.com/users/${name}`);
let data = await response.json()
return data;
}
getUserAsync('yourUsernameHere')
.then(data => console.log(data));