Has path tester
[data/tree/Has path tester]
Tests whether a path is found in the specified tree data structure. Example:
["foo", "bar", "baz"]@0 is received via
path
{"foo": { "bar": { "baz": 0 }}}@0 is received via
tree
true@0 is sent via
has
Keywords: path, tree, key, hasOwnProperty, exists
Input ports
path:
(string or number)[]
The path to look for in the
tree
Example: ["foo", 1, "bar"] would match for the followingtree
: {"foo":[0, {"bar": "baz"}]}tree:
(any[] or {string: any})
The tree data structure to find the
path
within
Output ports
has:
boolean
Whether the
path
was found in thetree
Last updated