Sometimes, you might want to convert a string to upper case and send the data to an API.
For example, let's say a user has submitted a form, but before saving the data to the database, you have to change the casing of the string to make sure the string is in uppercase.
This is just one use case when we need to change the casing of a string to upper case.
Understanding the toUpperCase Method
Let's look at some code to see how we use the toUpperCase method.
const nameInMixedCasing = "CodE LiKE a deV"; const nameInUpperCase = nameInMixedCasing.toUpperCase(); // Result: "CODE LIKE A DEV"