Javascript HashTable use Object key
Here is a simple Map implementation that will work with any type of key, including object references, and it will not mutate the key in any way: function Map() { var keys = [], values = []; return { put: function (key, value) { var index = keys.indexOf(key); if(index == -1) { keys.push(key); values.push(value); } … Read more