Solución
solution.tsTypeScript
function countWordsByLength(sentence: string, length: number): number {
// Tu código aquí
if (sentence.length === 0) return 0;
let count = 0
const words = sentence.split(' ').filter( word => word !== '');
words.map( word => {
word.length === length ? count++ : 0
})
return count;
}
// No modificar: necesario para evaluar el resultado.
export { countWordsByLength };0respuestas