How to tell if a JavaScript variable is a reference to another variable
If I make an object, and then set another variable equal to that object,
it's just a pointer to the original object. Is there a way to tell if a
variable is just a reference, and if so, determine the original variable
name?
E.g if I want to json encode an object that has a property that references
back to the original object, it creates an infinite loop. I'd like to test
if a property is a reference and if so just mark it as such, without
rewriting the same object.
No comments:
Post a Comment