How Collection() works?

collection | Collection
A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has an ID, for significantly improved performance and ease-of-use.
7 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Squid
Squid2y ago
It's just a class that extends the native Map class
Gonzaliito
GonzaliitoOP2y ago
Can you give me an example?
Squid
Squid2y ago
const collection = new Collection() ?
Gonzaliito
GonzaliitoOP2y ago
Is like an array but better? To improved performance
Squid
Squid2y ago
Look at the embed from your link
A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has an ID, for significantly improved performance and ease-of-use.
Gonzaliito
GonzaliitoOP2y ago
ok, thanks
Want results from more Discord servers?
Add your server