Skip to content

Commit a6f4069

Browse files
committed
Updated
1 parent 9596f9b commit a6f4069

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

docs/src/content/docs/en/concepts/predicates.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: Predicates
33
description: Tree predicates.
44
---
55

6-
# Predicates
7-
8-
Predicates are functions that return a boolean value. They are used to filter nodes, simplifying code and making it much more readable. Because they are efficient, they can be easily combined to create complex structural queries.
6+
Predicates are functions that return a boolean value. They are used to filter nodes, simplifying code, and making it more readable. The predicates allows the developer to extract the desired information, in an efficient manner, without having deep knowledge of the underlying tree structure. They reduce the risk of bugs creeping in, as correct tree traversal code can be tricky to write. They can be combined to create complex structural queries. They are also efficient, even beating manual traversal code written by the author.
97

108
> **Mental Model:** Always think of predicates from the *current evaluated node's* perspective (e.g., *"Is this node a descendant of X?"*, *"Does this node have children?"*).
119

0 commit comments

Comments
 (0)