Javascript string toUpperCase() is an inbuilt function that converts a string to uppercase letters. The string toUpperCase() method returns the calling string value converted to uppercase. The toUpperCase() method does not affect the value of the string itself since JavaScript strings are immutable. You cannot call this method on null or undefined**.** If you call them, you will get a TypeError will be thrown.

Javascript String ToUpperCase Example

If you want to convert into lowercase characters then check out toLowerCaseexample.

The toUpperCase() method does not take any arguments and returns a converted uppercase string. See the syntax below.

string.toUpperCase()

Let’s see the example.

// app.js

let strA = 'avengers will be a great movie';
console.log(strA.toUpperCase());

#javascript #uppercase #undefined #typeerror #touppercase

Javascript String ToUpperCase Example | JS toUpperCase()
1.60 GEEK