Vegito commented on a Page, Sort Array of IRC Nicks With Modes  -  Apr 09, 2014

names = ['~billy','~PennyBreed','~someHelper','+SomeDude','SomeGal','~Abby'];

When I run it, I get following result:

["~Abby","~PennyBreed","~billy","~someHelper","+SomeDude","SomeGal"]

Uppercase goes before lowercase.
idk if that is suppose to happen.

PennyBreed  -  Apr 09, 2014

Indeed. Switching them toLowerCase() before comparing them fixes this. Snippet updated.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.