Internal representation of a hashtable && hashmap is,
In Java, hashtable and hashmap is differentiated in terms of synchronous/asynchronous operation, otherwise internal representation is same.
Javascript object literal notation,
var obj = {
e1: 1,
e2: 2,
e3: 3
};
can be directly used as hashtable and hashmap with its internal hashing function. Object literal has string or Symbols as keys.
ES6 has also introduced window.Map
with any value as keys.
1) Does the above internal representation for hashtable and hashmap, looks correct? (or) Is there a difference in internal represenation of hashtable and hashmap?
2) Does Javascript object literal provide O(1) computation for hashtable/hashmap without any collision?