Solución
solution.tsTypeScript
function splitCamelCase(text: string): string[] {
// Escribe tu solución aquí
let currentWord: string = '';
const arr: string[] = [];
text.split('').forEach(letter => {
if(letter === letter.toUpperCase()){
arr.push(currentWord);
currentWord = letter.toLowerCase();
}else{
currentWord += letter;
}
});
arr.push(currentWord);
if(!currentWord) return [text];
return arr;
}
// No modificar: necesario para evaluar el resultado.
export { splitCamelCase };0respuestas