toUpperCase()

ES3+

Returns the string converted to upper case.

Syntax

string.toUpperCase()

Return Value

string

A new string representing the original string in upper case

Examples

JavaScript
const str = 'Hello World';
console.log(str.toUpperCase());
Output:
// 'HELLO WORLD'

Related Methods