Phaser API Documentation


Member of: Phaser.Utils.Array

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


Returns all elements in the array.

You can optionally specify a matching criteria using the property and value arguments.

For example: getAll('visible', true) would return only elements that have their visible property set.

Optionally you can specify a start and end index. For example if the array had 100 elements, and you set startIndex to 0 and endIndex to 50, it would return matches from only the first 50 elements.


name type arguments description
array array

The array to search.

property string <optional>

The property to test on each array element.

value * <optional>

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.


All matching elements from the array.

  • array
Since: 3.4.0
Source: src/utils/array/GetAll.js (Line 9)