Javascript is a widely used scripting or programming language. Programmers often use Javascript to work with or manage data. For example, you receive certain data from a user in HTML form fields. If you receive data from a user, you cannot check what he or she prints. However, it is also necessary to present the data in a good format. Users can enter uppercase letters where they are not needed, or vice versa. If you are a programmer and you store data in a database or display it on a web page, you need to take care of this function. To do this, we have a built-in Javascript function toLowerCase() to convert a string to lowercase.

Syntax

The syntax of the toLowercase() function in Javascript is the following:

The toLowerCase() function converts all alphabets in a string to lowercase. This function does not change the value of the original variable. Instead, the function creates a new line for the instance. Therefore, the function does not accept arguments, although the arguments are indicated in brackets (). But with the toLowercase() function you follow the same conventions as with the toLowercase() function.
Now let’s look at some examples.

Examples

Suppose there is a line that contains a few upper and lower case letters, such as the next line:

let str = Welcome to our LinuxHint.

Javascript toLowerCase Function
But we have to convert the whole string to lowercase. So we just use this:

Javascript toLowerCase Function
As you can see the string has been converted to a formatted string. All letters are now lowercase. It’s as simple as that.

This function is intended for the line. But it’s not just limited/limited. We can apply the function to a set of strings and even to a set of objects with strings.

Well, let’s see:
We will first write a series of strings as follows:

let arr = [Hey, LinuxHint, GREAT]

Javascript toLowerCase Function
Now, to replace the term GRAND with all lowercase letters, we use the following :

where 2 is the GREAT clue.
Javascript toLowerCase Function
As you can see the term BIG is now converted to lowercase. We did something similar for the other two channels: [0] for the term Hi and [1] for the term LinuxHint.
Now let’s see how we can apply this function to a series of objects where the objects contain a string, as follows

let arr = [name : [John], [name: [BOB], [name: [Ivan]

Javascript toLowerCase Function
To convert the term BOB into all lowercase letters, we will change it as follows:

arr[1].name.toLowercase() ;

Javascript toLowerCase Function
Awesome. As you can see, we can do a lot with the toLowerCase() function in Javascript.

Conclusion

In this article we have shown how strings can be converted into lowercase letters. We also showed how the same function can be applied to a series of strings and a series of objects containing strings. I hope this article has helped to make the informal chain a cleaner, more formal lowercase chain. More information about Javascript can be found on linuxhint.com.

You May Also Like

GBWhatsapp APK Download Latest Version V16.29 (Anti-Ban)

GBWhatsApp GBWhatsApp is the nine-modified version of the offiziellen WhatsApp. If you…

Sony SAB tv download for PC Free [Windows 7,8,10]

Last update : 16 hours Exotic Irfan Many people are looking for…

How to Improve Customer Satisfaction? Amazing Tips for 2020

There are two possibilities for the economy in 2020: failure or opportunity.…

Samsung Service Centers in Mumbai, Thane, Navi Mumbai (Authorised)

Samsung Service Centers in Mumbai : Samsung has launched its latest smartphones…