Hello just learning async functions. I'm attempting to push the results of a fetch call to an array from within an async function
Console result is 0 (there are 10 users). Love to know what I'm doing wrong, thanks
let users = [];
async function fetchUsers() {
const response = await fetch('https://jsonplaceholder.typicode.com/users');
const data = await response.json();
console.log(data);
users.push(data);
}
fetchUsers();
console.log(`There are ${users.length} users`)