.toUpperCase()

Convert a string to uppercase letters.

Syntax

string.toUpperCase();

Example 1

Converting lowercase letters to uppercase:

console.log('hello world'.toLowerCase());
// Output: HELLO WORLD

Example 2

Don’t forget that .toUpperCase() doesn’t actually change the original string.

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn JavaScript on Codecademy

Contributors