I would like to get the key
information in my for await...of
loop:
for await (const user of users) {
const userData= await fetchUserData(user.id)
}
But I get the error .for is not iterable
when I do it like this:
for await (const [key, user] of users) {
console.log(`fetching user ${key} out of ${users.length} users`)
const userData= await fetchUserData(user.id)
}
Is there a way to get the information about key
in my loop ?