Ad
  • Custom User Avatar

    Will be broken with string including numbers, like ["Flight93", "Flight 123"], or with non-ASCII characters. That's why localeCompare() should be required.

  • Custom User Avatar

    It depends on what you call "sorting". Yes,

    [4,15].sort() == [15,4]
    

    (which is really strange, by the way). This is one reason I use time zero-padded numbers for a long time already:

    ['04', '15'].sort() == ['04', '15']
    

    Which is correct. But thanks for the reminder ;) In the Kata I only test for alphabetic sorting, so this is not an issue.