Solución
solution.tsTypeScript
// Define aquí el type alias GpsCoords para una tupla [number, number]
type GpsCoords = [number, number]
export function formatCoords(coords: GpsCoords): string {
// Retorna un string con el formato "lat: X, lng: Y"
// donde X e Y tienen 2 decimales fijos
return `lat: ${coords[0].toFixed(2)}, lng: ${coords[1].toFixed(2)}`;
}0respuestas