Solución

@josemcarrizosa98_f7e20d3d
·20/3/2026TypeScript
solution.tsTypeScript
function splitCamelCase(text: string): string[] {
  let currentWord = text.charAt(0).toLowerCase();
  const words : string[]=[];

  
  for(let i = 1; i < text.length; i++){
     if(text.charAt(i).toUpperCase() === text.charAt(i)){
        words.push(currentWord);
        currentWord = "";
     }
     currentWord = currentWord + text.charAt(i).toLowerCase();
     

  } 

  words.push(currentWord);
  console.log(words);

  return words

}

// No modificar: necesario para evaluar el resultado.
export { splitCamelCase };
0respuestas
Respuestas
0

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.
Markdown