Undefined ?

Why i get undefined
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);

console.log(client.users.cache.forEach(user => {
if(user.bot || user.system) return;
console.log(user)
}))

});
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);

console.log(client.users.cache.forEach(user => {
if(user.bot || user.system) return;
console.log(user)
}))

});
Solution:
Now i see that random console.log
Jump to solution
2 Replies
kyra
kyra2y ago
Not a discord.js question but rather a JavaScript one. Map#forEach always return undefined.
Solution
ox
ox2y ago
Now i see that random console.log
Want results from more Discord servers?
Add your server