Can anyone verify this for me? JavaScript does not have a version of strcmp(), so you have to write out something like:
( str1 < str2 ) ?
-1 :
( str1 > str2 ? 1 : 0 );
What about
str1.localeCompare(str2)