var foo = new Object(); var bar = new Object(); var map = new Object(); map[foo] = "foo"; map[bar] = "bar"; alert(map[foo]); //This alerts bar, but what happens to foo? This is one of those questions to help with your understanding of how keys are assigned in JS. Of course, I immediately tried the following: […]
The post Why does this property assignment overwrite the prior property in JavaScript? appeared first on BlogoSfera.