Solución
solution.tsTypeScript
function countCapitalizedWords(text: string): number {
if (text.length <= 0) return 0
const textToArr = text.split(" ")
return textToArr
.filter(word => word.length >= 1)
.filter(word => word[0].toUpperCase() === word[0]).length
}
// No modificar: necesario para evaluar el resultado.
export { countCapitalizedWords };0respuestas