Comparing strings
The localeCompare function returns a number that indicates how a string should be ordered in relation to another string.
This is commonly used in an array sort function to arrange a list of strings into alphabetical order.
The localeCompare function returns a number that indicates how a string should be ordered in relation to another string.
This is commonly used in an array sort function to arrange a list of strings into alphabetical order.