- Instant help with your JavaScript coding problems

Convert string to uppercase with JavaScript

Question:
How to convert string to uppercase with JavaScript?
Answer:
const str = 'This is A Text with Mixed Cases';

const strUpper = str.toUpperCase();

console.log(strUpper); // THIS IS A TEXT WITH MIXED CASES
Description:

You can convert a string value to be all upper case letters using the toUpperCase method. The toUpperCase() method returns the calling string value converted to upper case. The method does not affect the value of the original string itself.

Share "How to convert string to uppercase with JavaScript?"