You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/03-string/article.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -538,11 +538,11 @@ Luckily, all modern browsers (IE10- requires the additional library [Intl.JS](ht
538
538
539
539
It provides a special method to compare strings in different languages, following their rules.
540
540
541
-
The call [str.localeCompare(str2)](mdn:js/String/localeCompare):
541
+
The call [str.localeCompare(str2)](mdn:js/String/localeCompare) returns an integer indicating whether `str` comes before, after or is equivalent to `str2` according to the language rules:
542
542
543
-
- Returns `1`if `str` is greater than `str2` according to the language rules.
544
-
- Returns `-1`if `str` is less than `str2`.
545
-
- Returns `0` if they are equal.
543
+
- Returns a negative number if `str` is less than `str2`, i.e. `str` occurs before `str2`.
544
+
- Returns a positive number if `str` is greater than`str2`, i.e. `str` occurs after`str2`.
0 commit comments