Solución
solution.tsTypeScript
function lengthOfLastWord(text: string): number {
const textToObject = text.split(' ');
const cleanSpace = textToObject.filter( word => word !== '')
const countLengthOfLastWord = cleanSpace.toReversed()[0].length
console.log(countLengthOfLastWord)
return countLengthOfLastWord;
}
// No modificar: necesario para evaluar el resultado.
export { lengthOfLastWord };0respuestas