Created
October 4, 2012 22:30
-
-
Save martindevans/3836881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Use an object as a set | |
var set = {} | |
//Create an object, give it some property | |
var item = {} | |
item.Foo = function() {}; | |
set[item] = item; | |
for (key in set} | |
{ | |
key.Foo(); //<-- nope | |
} | |
for (key in set) | |
{ | |
set[key].Foo(); //<-- just fine | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment