Javascript - String toUpperCase() Method

The toUpperCase() method converts a string to uppercase letters.

Description

The toUpperCase() method converts a string to uppercase letters.

The toUpperCase() method does not change the original string.

Syntax

string.toUpperCase()

Parameters

None

Return

A String, representing the value of a string converted to uppercase

Example

Convert the string to uppercase letters:

Demo

//convert the string to uppercase letters.
var str = "Hello World!";
var res = str.toUpperCase();
console.log(res);//  w w  w  .j  a  va  2  s. com

Result