.toUpperCase()

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Jun 19, 2021Updated Jul 31, 2023
Contribute to Docs

Convert a string to uppercase letters.

Syntax

string.toUpperCase();

Example 1

Converting lowercase letters to uppercase:

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

Example 2

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

Code
Output
Loading...

All contributors

Looking to contribute?

Learn JavaScript on Codecademy