Tweak comments and remove trailing space
Be explicit when sorting is intended

It avoids duplication and makes the intention clearer.
Avoid for
Use a more common idiom for array initialisation

In addition, a < [b, c].min is the same as a < b || a < c, because if
it's less than the smaller, it'll definitely be less than the larger.
Expressing it this way is simpler, I think.
Prefer if/else to ternary
Tweak spacing and remove unnecessary parens