Solución
solution.tsTypeScript
function countVowels(text: string): number {
const vocal = ['a', 'e', 'i', 'o', 'u'];
let value = 0;
vocal.forEach(e => {
const filt = [...text].filter(char => e === char);
if (filt.length > 0) {
value = filt.length + value;
}
})
return value;
}
// No modificar: necesario para evaluar el resultado.
export { countVowels };0respuestas