After reading this description: http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps
I’m trying to get a hang of it, but I do not get the overall picture. What is it all about? It seems to be supported in Firefox 6: http://kangax.github.com/es5-compat-table/non-standard/
WeakMap
WeakMaps basically allow you to have a HashTable with a key that isn’t a String.
So you can set the key to be, i.e.
[1]and then can sayMap.get([1])Example from the MDN:
The reason for its existance is:
Apparently emulating weakmaps causes memory leaks. I don’t know the details of those memory leaks.