>>2104>>2108>implying OP isn't a trollIf we did something like this:
arraySort([5, 4, 3, 2, 1, pow(2, 653)])
OP's code would try to allocate a second array with 2^653 + 1 elements in it (seriously).
Though
technically, OP's algorithm has something like O(n) time complexity, so it might actually run faster than real algorithms if all of the members of the array are very small.