Interesting article. When I think of hash maps I think of them as an array of "buckets", with each bucket being an array of length 2 ([key, value]).
Initializing your hashmap as an empty Javascript object and assigning the keys as properties of that object you are essentially just using the baked in javascript definition of a hash map in your implementation of a hash map. Javascript objects are already hashmaps in their implementation. I hope that makes sense.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interesting article. When I think of hash maps I think of them as an array of "buckets", with each bucket being an array of length 2 ([key, value]).
Initializing your hashmap as an empty Javascript object and assigning the keys as properties of that object you are essentially just using the baked in javascript definition of a hash map in your implementation of a hash map. Javascript objects are already hashmaps in their implementation. I hope that makes sense.