lastWhereNot()

Finds the last item in an array which does not match the specified criteria.

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

Parameters

{Array|null|undefined} array
If an array is given each item will be traversed from end to start to find the last item which does not match the given rules. If undefined or null is given then a partial lastWhereNot() function is created with just the rules that were given which will accept only the array parameter.
{…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

{*}
The last value in array which fails at least one of the specified rules.

Required Function

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

  • findWhere()
    Finds the first item in an array which matches the specified criteria.

Requiring Function

This function is directly required by the following function:

  • findWhere()
    Finds the first item in an array which matches the specified criteria.