Start from this element.
Rest
...path: readonly (string | number)[]A list of instructions, like 0
to take the first child element or a string to look for an element with that tag name.
The requested Element
, or undefined
if there were any problems.
Walk through a path into an XML (or similar) document.
Note that tag names must be unique. If you have an element like
and you say
followPath(parent, "twin")
the result will beundefined
because we don't know which twin to return.followPath(parent, "unique")
will return the last child element.