Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> StableSort(array, [compare])

Description:

An in-place stable array sort, because Array#sort() is not guaranteed stable.

This is an implementation of merge sort, without recursion.

Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable

Parameters:

name type arguments description
array array

The input array to be sorted.

compare function <optional>

The comparison function.

Returns:
Description:

The sorted result.

Type:
  • array
Since: 3.0.0