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
kyra16mo ago
Not a discord.js question but rather a JavaScript one. Map#forEach always return undefined.
Solution
ox
ox16mo ago
Now i see that random console.log