Applies predicate to root and all its child nodes, returning the node value for predicate yields true. Use find to filter by nodes rather than values
predicate
root
const n = findByValue(root, (v) => v.name === 'Bob'); Copy
const n = findByValue(root, (v) => v.name === 'Bob');
Iterate children by breadth or depth. Default 'breadth'
Applies
predicate
toroot
and all its child nodes, returning the node value forpredicate
yields true. Use find to filter by nodes rather than values