7

I'm struggling with some d3.js v4 troubleshooting and I suspect that some objects that I think are the same are not, in fact, the same object.

In Python I could do print("obj1:%s" % (id(obj1))), print("obj2:%s" % (id(obj2))).

That gives me the Python memory allocation for the object and if they match I know they are the same objects. Is there anything equivalent in JS?

This is related to How to know that javascript variable point to the same memory address, but unlike that case, both references are not in scope at the same time so I can't === them.

JL Peyret
  • 10,917
  • 2
  • 54
  • 73
  • Interesting question, but probably duplicate. In essence, as I understand them, the answers in the linked Q+A can be summarized as "there is no native identifier, but you can implement your own". – Pac0 May 29 '18 at 19:13
  • yeah, i'm good with the duplicate. not all that happy with the answer, but hey, that's nothing to do with SO. – JL Peyret May 29 '18 at 19:16

0 Answers0