Javascript toUpperCase: How to convert uppercase string

To convert a string into lowercase characters in JavaScript, use the toLowerCase() method. The toUpperCase() method takes no arguments and returns a converted uppercase string.

Javascript toUpperCase

Javascript toUpperCase() is a built-in string function that converts a string to uppercase letters. The toUpperCase() method returns the calling string value converted to uppercase.

To convert a string to uppercase in JavaScript, use the toUpperCase() method. The toUpperCase() method does not affect the value of the string since JavaScript strings are immutable. However, you cannot call this method null or undefinedIf you call them, you will get a TypeError will be thrown.


See the syntax below.



Let’s see the example.

// app.js

let strA = 'avengers will be a great movie';

The output is the following.

Javascript String ToUpperCase Example

The String toUpperCase() function converts an entire string to the Upper case. Therefore, the function does not affect any special characters, digits, and alphabets already in the upper case.

See more examples.

// app.js


See the output below.

String.prototype.toUpperCase() Tutorial

That’s it for converting string to uppercase in the JavaScript tutorial.

Related posts

Javascript String toLocaleUpperCase()

Javascript String toLocaleLowerCase()

JavaScript String toLowerCase()

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.