![]() |
VOOZH | about |
The JavaScript toLowerCase() method Converts all characters of a string to lowercase and returns a new string without changing the original.
str.toLowerCase();The toLowerCase() method returns a modified version of the original string. It converts all uppercase letters into lowercase.
[Example 1]: Converting all characters of a string to lowercase
The toLowerCase() method converts all characters in the string 'GEEKSFORGEEKS' to lowercase. The resulting string 'geeksforgeeks' is then logged to the console.
[Example 2]:Converting elements of array to lowercase
The code uses map() to convert each array element to lowercase with toLowerCase(), producing ['javascript', 'html', 'css'] and logging it to the console.