Solución
solution.tsTypeScript
function capitalizeWords(text: string): string {
let newText = text.split(" ");
let arr = []
newText.forEach(word => {
let firstLetter = word[0].toUpperCase();
let restOfWord = word.slice(1);
arr.push(firstLetter+restOfWord)
console.log(firstLetter + restOfWord);
});
return arr.join(' ')
}
// No modificar: necesario para evaluar el resultado.
export { capitalizeWords };0respuestas