In JavaScript, you can use the toUpperCase() method to convert a string to uppercase. Here is an example:

let string = "Hello World";
let upperCaseString = string.toUpperCase();
console.log(upperCaseString); // Output: "HELLO WORLD"

You can also use toLowerCase() to convert a string to lowercase.

Also Read:

Categorized in: