how to compare strings alphabetically in javascript