How to convert lowercase letter to upper case with JavaScript?

Sometimes, we want to convert lowercase letter to upper case with JavaScript.

In this article, we’ll look at how to convert lowercase letter to upper case with JavaScript.

How to convert lowercase letter to upper case with JavaScript?

To convert lowercase letter to upper case with JavaScript, we can use the string’s toUpperCase method.

For instance, we write:

const str = 'abc'
const newStr = str.toUpperCase();
console.log(newStr)

to call str.toUpperCase to return a string with characters in str converted to upper case.

Therefore, newStr is 'ABC'.

Conclusion

To convert lowercase letter to upper case with JavaScript, we can use the string’s toUpperCase method.