how to use uppercase in javascript code example
Example 1: uppercase javascript
var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!
Example 2: uppercase in word javascript
function toTitleCase(str) {
return str.replace(/\w\S*/g, function(txt){
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
Example 3: uppercase javascript
var str = "Hello World!";
var res = str.toUpperCase();