Hacker News new | ask | show | jobs
by globalise83 1145 days ago
Nice! I have used Maps often for storing arbitrary key-value pairs, but until 5 minutes ago I didn't know you could use object references as keys. So this was a very good use of 5 mins.
1 comments

Same applies to Set, too. You can store an object, or instance, then use "has" to check for it.