Phaser API Documentation

  Version: 

Member of: Phaser.Structs.List

getFirst(property, value, [startIndex], [endIndex])

Description:

Returns the first element in a given part of the List which matches a specific criterion.

Parameters:

name type arguments description
property string

The name of the property to test or a falsey value to have no criterion.

value *

The value to test the property against, or undefined to allow any value and only check for existence.

startIndex number <optional>

The position in the List to start the search at.

endIndex number <optional>

The position in the List to optionally stop the search at. It won't be checked.

Returns:
Description:

The first item which matches the given criterion, or null if no such item exists.

Type:
  • *
Examples:
Since: 3.0.0
Source: src/structs/List.js (Line 256)