.localeCompare()

Term side of the Card
Topic: String
Unit title: .localeCompare()
Categories: Method
Explanation side of the Card

Explanation: The method that compares two strings based on their Unicode code points and locale-specific rules. It returns a number indicating whether the string comes before, after or is the same as another string in sort order.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1
  • The edge browser supports this feature starting from version 12
  • The firefox browser supports this feature starting from version 1
  • The safari browser supports this feature starting from version 3
Availability: