The toLowerCase() function converts all the alphabets in a string into lower-case letters. This function does not change the original value of the variable. Instead, the function creates a new string for the instance. In this way, the function does not take any arguments, although the parentheses “()” are used for taking arguments. But, with the toLowercase() function, you follow the same conventions of a function.
Let us now look at some examples.
Suppose there is a string that includes some uppercase and lowercase letters, such as the following string:
But, we need to convert the string entirely into lower-case letters. So, we will simply apply the following:
As you can see, the string has been converted to a formatted string. All the letters are now in lower-case format. It is as simple as that.
This function is for the string. But, this is not only restricted/limited here. We can apply the function to an array of strings and even to an array of objects containing strings, as well.
Let us take a look:
First, we will write down the array of strings, as follows:
Now, to change the term “GREAT” to all lowercase letters, we will apply the following:
where ‘2’ is the index of “GREAT”.
As you can see, now, the term “GREAT” has been converted into lower-case letters. We did something similar for two other strings:  for the term “Hi” and  for the term “LinuxHint.”
Let us now see how we can apply this function to an array of objects in which the objects contain the string, as follows:
To convert the term “BOB” to all lower-case letters, we will change it as follows: