First off, I know this is far from professional. I\'m trying to learn how to work with strings. What this app is supposed to do is take a simple text input and do a few thi
Another solution is using Array.from() make an array which includes each character of str and then using reduce() to count the number of the uppercase letters.
const str = 'HeLlO';
const res = Array.from(str).reduce((acc, char) => {
return acc += char.toUpperCase() === char;
}, 0);
console.log(res);