Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> SafeRange(array, startIndex, endIndex, [throwError])

Description:

Tests if the start and end indexes are a safe range for the given array.

Parameters:

name type arguments Default description
array array

The array to check.

startIndex number

The start index.

endIndex number

The end index.

throwError boolean <optional> true

Throw an error if the range is out of bounds.

Returns:
Description:

True if the range is safe, otherwise false.

Type:
  • boolean
Since: 3.4.0