indicesWhere()

Finds the positions of the items in an array which match the specified criteria.

This function is valid in v2.23.0. This function has been downloaded 2 times.

Parameters

{Array|null|undefined} array
If an array is given each item will be traversed from start to end to find the positions of the items which match the given rules. If undefined or null is given then a partial indicesWhere() 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

{Array}
An array of positions of items in array which pass all 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.