In JavaScript, all Objects act a bit like hashmaps. However, the keys to these hashmaps must be strings. If they\'re not, they\'re converted with toString(). Tha
toString()
the answer is to use two arrays, one for keys, one for values.
var i = keys.indexOf(key) if (i == -1) {keys.push(key); values.push(value)} else {values[i] = value; }
I would recommend you the jshashtable project from Tim Down.