Comparing Non-English Strings with JavaScript Collators

John Au-Yeung
Level Up Coding
Published in
9 min readNov 26, 2019

--

Photo by Kyle Glenn on Unsplash

With the combination of the double equal or triple equal operator with string methods, we can compare strings easily in a case-sensitive or case insensitive manner. However, this doesn’t take into account the characters that are in non-English strings like French or Italian. These languages have alphabets that may contain accents, something that isn’t recognized in normal string comparisons.

--

--