Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> CountAllMatching(array, property, value, [startIndex], [endIndex])

Description:

Returns the total number of elements in the array which have a property matching the given value.

Parameters:

name type arguments description
array array

The array to search.

property string

The property to test on each array element.

value *

The value to test the property against. Must pass a strict (===) comparison check.

startIndex number <optional>

An optional start index to search from.

endIndex number <optional>

An optional end index to search to.

Returns:
Description:

The total number of elements with properties matching the given value.

Type:
  • number
Since: 3.4.0