Find the nearest ancestor of a target node that matches a predicate.
Walks the tree from the root, tracking the ancestor stack. When the target is found, searches ancestors from nearest to farthest.
Uses reference equality (===) to identify the target.
===
The matching ancestor, or null if none matches or target not found.
null
Find the nearest ancestor of a target node that matches a predicate.
Walks the tree from the root, tracking the ancestor stack. When the target is found, searches ancestors from nearest to farthest.
Uses reference equality (
===) to identify the target.