Solución
solution.tsTypeScript
export function formatValue(value: string | number): string | number {
// Usa typeof para distinguir string de number y actuar distinto en cada caso
if(typeof value === 'string' && typeof value !== 'number' ) {
return value.toUpperCase()
}
return value * 2;
}
0respuestas