Horje
What is toUpperCase() Method in JavaScript ?

JavaScript String toUpperCase() method converts the entire string to Upper case. This method does not affect any of the special characters, digits, and the alphabets that are already in the upper case. 

Syntax:

str.toUpperCase()

Example: Here, the toUpperCase() method is called on the str string, converting all lowercase letters to uppercase. The resulting string, "HELLO WORLD", is assigned to the variable upperStr.

Javascript

const str = "hello world";
const upperStr = str.toUpperCase();
 
console.log(upperStr); // Output: "HELLO WORLD"

Output

HELLO WORLD



Reffered: https://www.geeksforgeeks.org


JavaScript

Related
What is toLowerCase() Method in JavaScript ? What is toLowerCase() Method in JavaScript ?
How to Convert a String to Uppercase in JavaScript ? How to Convert a String to Uppercase in JavaScript ?
What is hasOwnProperty() method in JavaScript ? What is hasOwnProperty() method in JavaScript ?
How to Lowercase a String in JavaScript ? How to Lowercase a String in JavaScript ?
What is includes() Method in JavaScript ? What is includes() Method in JavaScript ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12