The default semantics of Array.prototype.sort
can not be changed for existing inputs, as this would break the web.
Note: TypedArrays thankfully don't have this issue: TypedArray.prototype.sort() - JavaScript | MDN
The most likely 'fix' here is if there was perhaps a convenient sorting function available: Builtin Ord / Compare method for primitives