klyn.collections.Array.sortNew
method
public native sortNew() as Array<T>
Description

Returns a sorted copy without modifying the current array.

import klyn.collections

values as Int[] = Int[2]
values[0] = 2
values[1] = 1
sorted = values.sortNew()
print(sorted)              # f:[1, 2]
print(values)              # f:[2, 1]
Returns

A new array with the same fixed size and sorted elements.