by @codeexamples

How to convert a JavaScript String to Upper Case

Home » javascript » How to convert a JavaScript String to Upper Case

To convert a string to uppercase we can use the built-in toUpperCase() method in JavaScript.

Here is an example that converts a string how are you to uppercase.

const message = "how are you";

const uppercaseMsg = message.toUpperCase();

console.log(uppercaseMsg);

Output:

'How ARE YOU'