Solución
solution.tsTypeScript
// Implementa loadData usando funciones internas handleSuccess y handleError
// Si id > 0: retorna handleSuccess("dato-" + id)
// Si id <= 0: retorna handleError("ID inválido")
export function loadData(id: number): string {
// Define handleSuccess y handleError aquí, luego úsalas
const handleSuccess = (data: string): string => data;
const handleError = (msg: string): string => msg;
if( id > 0 ) return handleSuccess(`dato-${id}`);
if( id <= 0 ) return handleError('ID inválido');
}
0respuestas