How to Convert a String to Uppercase with JavaScript

Learn how to convert any text case to uppercase with JavaScript.

To convert any string to you can use the JavaScript toUpperCase() method:

let someText = "Here is some text. Let us convert it all to uppercase"

someText.toUpperCase()

console.log(someText.toUpperCase())
// "HERE IS SOME TEXT. LET US CONVERT IT ALL TO UPPERCASE"

toUpperCase() returns a new string, which means that it does not mutate (change) the original string.


Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊

Kofi

Share & Discuss on