There are four methods involved in ECMAScript that involve string case conversion: toLowerCase(), toLocaleLowerCase(), toUpperCase() and toLocaleUpperCase().
Among them, toLowerCase() and toUpperCase() are two classic methods, borrowed from the method of the same name in it. The toLocaleLowerCase() and toLocaleUpperCase() methods are implemented for specific regions.
For some regions, the region-oriented method is the same as the results obtained by its general method, but a few languages (such as Turkish language) will apply special rules for Unicode case conversion. At this time, the region-oriented method must be used to ensure the correct conversion is achieved. Here are a few examples:
var stringValue = "hello world";
alert(()); //"HELLO WORLD"
alert(()); //"HELLO WORLD"
alert(()); //"hello world"
alert(()); //"hello world"123456
Code laycode - v1.1
The toLocaleUpperCase() and toUpperCase() called above both return "HELLO WORLD", just like calling toLocaleLowerCase() and toLowerCase() both return "hello world". Generally speaking, it is safer to use a region-specific approach without knowing which locale your code will run in.
The above article briefly talks about the difference between toLowerCase and toLocaleLowerCase is all the content I share with you. I hope you can give you a reference and I hope you can support me more.