How can we go up to several levels in the nested object beginning from one of it's deeply nested child? i'm dealing with yang language and in some objects I find a "path" substatement like "../../../../some node". So I need to go 4 levels up to find needed statement. Is there a way to do this in js?
Asked
Active
Viewed 155 times
0
-
Objects don't have references to their containers, there's no built-in way to go up. An object can be referenced from multiple places, so there's no unique parent. – Barmar Mar 12 '20 at 16:49
-
If you need this for your application, you'll need to add explicit `parent` properties to the objects. – Barmar Mar 12 '20 at 16:49