how to compare two strings alphabetically in javascript