Solución
solution.tsTypeScript
function countWordsStartingWithVowel(sentence: string): number {
let counter : number = 0;
const vowels : string = 'aeiou'
sentence.toLowerCase().split(' ').forEach(word => {
if (vowels.includes(word[0]))
counter++
})
return counter
}
// No modificar: necesario para evaluar el resultado.
export { countWordsStartingWithVowel };
0respuestas