someWhere()

Determines whether a specific test passes for at least one of the items in an array.

This function is valid in v2.23.0 to v2.24.3. This function has been downloaded 33 times.

Parameters

{Array} array
The array whose values should be checked against all of the rules.
{…Array} ruleX
An array containing (1) the path, (2) optionally the comparator as a string and (3) the value to check the variable at that path against. Each part of the path should be a separate item in the array. For example [\"details\", \"age\", \">=\", 18] can be used to make sure that array[index].details.age >= 18 occurs. If no comparator is supplied === will be used. If one of the paths doesn't exist the entire test will fail.

Returns

{boolean}
Returns true only if at least one of the values in array passes all of the given rules. Otherwise false is returned.

Required Function

This function directly requires the following function which is included automatically:

  • everyWhere()
    Determines whether a specific test passes for all of the items in an array.

Requiring Function

This function is directly required by the following function:

  • everyWhere()
    Determines whether a specific test passes for all of the items in an array.