Solución
solution.tsTypeScript
function countWordsStartingWithVowel(sentence: string): number {
let count : number = 0;
const words = sentence.split(' ')
for( let i : number = 0; i < words.length; i++ ) {
if ( /^[aeiouáéíóúAEIOUÁÉÍÓÚ]/.test(words[i]) ) count ++
}
return count;
}
// No modificar: necesario para evaluar el resultado.
export { countWordsStartingWithVowel };0respuestas