I have an interesting problem with a map that is broken in Firefox. When I test if an empty map has the string "watch" it will return true and return the function watch(). I want that to return false since I haven't added the key "watch" to the map. A quick example
I normally create a basic map like
var myMap = {}
myMap["apple"] = 1;
myMap["pear"] = 2;
And to test if the map has the object I would write
if ("apple" in myMap) { ... }
And the problem is when I want to add the string "watch" to the map if the map doesn't all ready contain it. So when I check to see if the map contains "watch" it returns true.
if ("watch" in myMap) { ... }
// This also returns true. and returns the function watch()
Any ideas on how to avoid this behaviour?
Thanks