The toLowerCase() method in JavaScript converts all characters in the string to lowercase and returns a new converted string. The original string is not affected: Usage: string.toLowerCase() Return value: Conversion After the new string, all characters are lowercase. Note: The original string will not be modified, only a new converted string will be returned.
JavaScript Usage of toLowerCase()
The toLowerCase() method is a built-in string method in JavaScript, used to convert all characters in the string to lowercase.
Usage:
<code>string.toLowerCase()</code>
Returns:
The toLowerCase() method returns a new string containing the original All characters in the string are converted to lowercase. The original string itself is not modified.
Example:
<code>const str = "HELLO WORLD"; const lowerCaseStr = str.toLowerCase(); console.log(lowerCaseStr); // 输出: "hello world"</code>
Note:
The above is the detailed content of How to use tolowercase in js. For more information, please follow other related articles on the PHP Chinese website!