Ad
  • Custom User Avatar

    Simply rely on the JS's builtin lexicographic comparison of strings, where uppercase are considered less than lowercase. But you're right that the description could make this explicit.

  • Custom User Avatar

    if we need to sort the channels in an alphabetical order, than we do not need sort it bind ASCII, but bind to alphabetical
    Than Error message is wrong:

    Expected: { '0': 'BBC Sport',
    '1': 'BBC1',
    '2': 'CNBC',
    '3': 'Channel 4',
    '4': 'Discovery',
    '5': 'Drama',
    '6': 'Film 4',
    '7': 'Film 5',
    '8': 'Food Network',
    '9': 'National Geographic',
    '10': 'Sky Sport',
    '11': 'SyFy' }, instead got: { '0': 'BBC Sport',
    '1': 'BBC1',
    '2': 'Channel 4',
    '3': 'CNBC',
    '4': 'Discovery',
    '5': 'Drama',
    '6': 'Film 4',
    '7': 'Film 5',
    '8': 'Food Network',
    '9': 'National Geographic',
    '10': 'Sky Sport',
    '11': 'SyFy' }

    Because, char 'h' have to stay first before char 'N' in an alphabetical order