DEV Community

Discussion on: JavaScript: How to implement a dictionary/map in 3mins.

Collapse
 
juliuskoronci profile image
Igsem

so object.keys will do a loop so we are talking about O(n) complexity while maintaining a count is O(1). So if we have 10000 elements in the map that is starting to be expensive. Also the map should be iterrable, I guess yours isnt yet :)

Thread Thread
 
chinedu profile image
chinedu | ddevguys

Thanks!