count capital letters in javascript code example
Example 1: javascript separate words by capital letter
"thisIsATrickyOne".split(/(?=[A-Z])/);
Example 2: javascript name capitalization
function capitalizeName(name) {
return name.replace(/\b(\w)/g, s => s.toUpperCase());
}