Solución
solution.tsTypeScript
def safe_get(d: dict, key: str):
# Accede a d[key] y retorna el valor
# Si la clave no existe, retorna "key_not_found"
try:
return d[key]
except KeyError:
return "key_not_found"0respuestas