You can use the localeCompare() method.
localeCompare()
string_a.localeCompare(string_b); /* Expected Returns: 0: exact match -1: string_a < string_b 1: string_a > string_b */
Further Reading:
2.1m questions
2.1m answers
60 comments
57.0k users