2

What is the difference between these two ?

The description for the toLocaleLowerCase() mentions Converts a string to lowercase letters, according to the host's locale.

What is the host's locale ?

thatOneGuy
  • 9,977
  • 7
  • 48
  • 90
  • It depends from where the users lives, and especially which language he uses. For example, I'm french and with have words with accents, just like `mangé`. I suppose that `toLocaleLowerCase` will check the users locale in order to change `maNgÉ` to `mangé` for me, but it might do something different for you. – tforgione Dec 16 '15 at 11:05
  • @DragonRock thanks :) someone beat you to writing your comment as an answer, but thanks anyway :) – thatOneGuy Dec 16 '15 at 11:07

1 Answers1

5

Definition and Usage as per w3schools

The toLocaleLowerCase() method converts a string to lowercase letters, according to the host's current locale.

The locale is based on the language settings of the browser.

Generally, this method returns the same result as the toLowerCase() method. However, for some locales, where language conflict with the regular Unicode case mappings occurs (such as Turkish), the results may vary.

Yogesh Salvi
  • 1,177
  • 2
  • 10
  • 17
  • Note: navigator.language and Accept-Language are not (necessarily) identical. More info: https://alicoding.com/detect-browser-language-preference-in-firefox-and-chrome-using-javascript/ – Lavi Avigdor Dec 16 '15 at 11:29