I have the following (nested) object:
obj: { subObj: { foo: 'hello world' } };
Next thing I do is to reference the subobject like this:
var s = obj.subObj;
Now what I would like to do is to get a reference to the object obj out of the variable s.
Something like:
var o = s.parent;
Is this somehow possible?
No. There is no way of knowing which object it came from.
sandobj.subObjboth simply have references to the same object.You could also do:
You now have three references,
obj.subObj,obj2.subObj, ands, to the same object. None of them is special.