Function
insertionSort
(array: T[], compare: (left: T, right: T) => boolean): voidSorts the array in-place using https. This is useful when you have a persistent (not per-frame) array of objects and they change on each frame but not by much, but the list must remain sorted. (For example, the list could be returned by get with the `liveUpdate` option enabled, and then stored somewhere.)
param
array- returns true if `[left, right]` is the correct order, false if `[right, left]` is the correct order.
since
v4000.0
group
Math
subgroup
Advanced