#any
Returns true if an array or string has contents, or, with a lambda, if any element matches.
#any(value, @x: predicate?)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
value |
path | array | string |
The array or string to test. |
predicate (optional) |
lambda |
When given, an element must satisfy it. |
Returns
Section titled “Returns”boolean
Examples
Section titled “Examples”Any element greater than five
Section titled “Any element greater than five”{ "some": { "integerArray": [ 1, 2, 6, 10 ] }}{ "hasValues": "#valueOf($.some.integerArray)->#any(@x: @x > 5)"}{ "hasValues": true}