I have the following object:
var object = {
"property1": "value1",
"property2": "value2",
"subobject": {
"property1": "value1",
"property2": "value2",
"subobject": {
"property1": "value1",
"property2": "value2",
"subobject": {...
}
}
}
}
I am trying to set one of the nested subobject properties, but the nested level is dynamic.
How can I dynamically set one of these nested properties without doing something like this: object.subobject.subobject = { ... }
?
Edit: So to be more specific, I am trying to set one of the nested subobjects, but I won't know which one each time.