i need to make a dictionary in javascript like this
i dont remember the exact notation, but it was something like:
states_dictionary={ CT=[alex,harry
Firefox 13+ provides an experimental implementation of the map
object similar to the dict
object in python. Specifications here.
It's only avaible in firefox, but it looks better than using attributes of a new Object()
. Citation from the documentation :
- An Object has a prototype, so there are default keys in the map. However, this can be bypassed using
map = Object.create(null)
.- The keys of an
Object
areStrings
, where they can be any value for aMap
.- You can get the size of a
Map
easily while you have to manually keep track of size for anObject
.