String.prototype.toUpperCase()
Returns the calling string converted to uppercase.
Syntax
str.toUpperCase() Returns
string — A new uppercase string.
Examples
console.log('Hello'.toUpperCase());
Output
HELLO
console.log('abc123'.toUpperCase());
Output
ABC123
Notes
Uses locale-independent Unicode case mappings. For locale-aware conversion
(e.g. Turkish dotted I) use `toLocaleUpperCase`. Does not mutate the original.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |
| node | 0.10 |