0

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?

Olga
  • 119
  • 1
  • 1
  • 12
  • 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

0 Answers0