I'm Angelos Chalaris, a web developer from Athens, Greece.
I love programming, learning new things and experimenting with new technologies. Currently working with JS and React.
Set is similar to an array, but it only contains values, not pairs. Map might be closer to what I'm talking about here, as it provides some methods such as Map.prototype.forEach() for example. Theoretically, extending Map to behave similar to an array in terms of methods would be an option to make an object that can be used much like an array. Both the solution I described above and this one have some pros and cons, so it depends on what you want to achieve.
Set is similar to an array, but it only contains values, not pairs. Map might be closer to what I'm talking about here, as it provides some methods such as
Map.prototype.forEach()
for example. Theoretically, extending Map to behave similar to an array in terms of methods would be an option to make an object that can be used much like an array. Both the solution I described above and this one have some pros and cons, so it depends on what you want to achieve.One extension of
Map
I use incredibly frequently isCollection
from@discordjs/collection
. A recommend you check it out!