JavaScript hash table implementation