Skip to content
Advertisement

Tag: data-structures

Set of objects in javascript

I’d like to have a set of objects in Javascript. That is, a data structure that contains only unique objects. Normally using properties is recommended, e.g. myset[“key”] = true. However, I need the keys to be objects. I’ve read that Javascript casts property names to strings, so I guess I can’t use myset[myobject] = true. I could use an array,

Advertisement