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