Skip to content

Glossary: Data Structures and Algorithms in JavaScript

localeCompare

A string method that compares two texts and returns a negative number, 0 or a positive number, which makes it handy inside a compare function for sorting text.

Where the book teaches it

Related terms

Comparator