Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> Swap(array, item1, item2)

Description:

Swaps the position of two elements in the given array. The elements must exist in the same array. The array is modified in-place.

Parameters:

name type description
array array

The input array.

item1 *

The first element to swap.

item2 *

The second element to swap.

Returns:
Description:

The input array.

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