Solución
solution.tsTypeScript
function camelToSnake(text: string): string {
let word = ''
for(let i = 0; i < text.length ; i++){
word += text[i].toUpperCase() === text[i]? "_" + text[i].toLowerCase() : text[i]
}
return word;
}
// No modificar: necesario para evaluar el resultado.
export { camelToSnake };0respuestas