🔙 String prototype locale compare

The localeCompare is a String function in JavaScript that returns an integer indicating whether the firstString comes before, after or is equivalent to the secondString.

It implements the compartor logic returning a negative number when the firstString occurs before secondString, a positive number the other way around, and 0 if they are equivalent. Beyond that, it may take locales so the method is localized by default.

peaonunes © 2021, now built with Gatsby