javascript compare two strings for sorting