I just read this question: are there dictionaries in javascript like python?
One of the answers said that you can use JavaScript objects like Python dictionaries. Is that true? What is the performance of a key lookup in an object? Is it O(1)? Is adding a key to the object also constant time (hashing)?
Best Answer
The V8 design docs imply lookups will be at least this fast, if not faster:
It sounds like adding a new key might be slightly slower, though, due to the hidden class creation.