I'm looking to do something like the task here Self-references in object literals / initializers , except that it would be for the value of an aunt/uncle key, or the sibling key of the parent object. For example:
const obj = {
parent: {
child: {
aunt: /* aunt object */
}
},
aunt: {
foo: {
bar: 1
}
}
}
There's a very similar ask here Reference nested 'sibling'-property in object literal but unfortunately, not quite what I'm looking for. Ideally, the solution would be extensible and probably would need to be to handle cases where I'd want to access a great-grandcousin object related to a key if need be. Thanks!