Solución
solution.tsTypeScript
function countWordsByLength(sentence: string, length: number): number {
let count = 0;
let words = sentence.split(" ");
words.forEach(word => {
if(word.length === length) {
count += 1;
console.log(count)
}
})
return count
}
// No modificar: necesario para evaluar el resultado.
export { countWordsByLength };0respuestas