
Fundamentals
JavaScript String localeCompare Explained With Examples
String localeCompare() sorts text the way people expect. See locales, numeric and sensitivity options, accent handling and when Intl.Collator is better.
7 min read
Tag
3 posts

String localeCompare() sorts text the way people expect. See locales, numeric and sensitivity options, accent handling and when Intl.Collator is better.

String indexOf() returns where a substring first appears, or -1. See the position argument, empty strings, code unit indexes and the truthiness trap.

String includes() answers whether one string appears inside another. See position, case sensitivity, the RegExp error and Unicode edge cases.