Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> Replace(array, oldChild, newChild)

Description:

Replaces an element of the array with the new element. The new element cannot already be a member of the array. The array is modified in-place.

Parameters:

name type description
array array

The array to search within.

oldChild *

The element in the array that will be replaced.

newChild *

The element to be inserted into the array at the position of oldChild.

Returns:
Description:

Returns true if the oldChild was successfully replaced, otherwise returns false.

Type:
  • boolean
Since: 3.4.0
Source: src/utils/array/Replace.js (Line 7)