That's a bugger :/ Regarding uniquely identifying objects, if we can compare objects by reference, doesn't it count as unique identifying? E.g. let a = { }; let a2 = a; let b = { }; a === a2, but b !== a2 .
In this case it was a problem about creating a deep copy of nodes in a graph. My “easy” approach involved using a map with the key being a reference to the original A and the value being the copy A* OR adding matching ids to A and A* and use a map to go from A to A*. They said no mutations to the original objects (ids are out the window) and then that led to the quibbling over addresses because you can’t use an object reference as a key in a map in JS (it’ll just stringify it in the map).
(I’m half hoping that after typing this out someone will reply with some data structure I’m unaware of that would allow you to uniquely map the reference of an object to an arbitrary value.)
(I’m half hoping that after typing this out someone will reply with some data structure I’m unaware of that would allow you to uniquely map the reference of an object to an arbitrary value.)