find uppercase letters in string javascript code example
Example 1: uppercase javascript
var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!
Example 2: find capital word in string javascript
const str = "HERE'S AN UPPERCASE PART of the string";
const upperCaseWords = str.match(/(\b[A-Z][A-Z]+|\b[A-Z]\b)/g);
console.log(upperCaseWords);