Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> MoveTo(array, item, index)

Description:

Moves an element in an array to a new position within the same array. The array is modified in-place.

Parameters:

name type description
array array

The array.

item *

The element to move.

index number

The new index that the element will be moved to.

Returns:
Description:

The element that was moved.

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