Leer la guía del ejercicio
- Lenguaje de programación
- TypeScript
- Dificultad
- Fácil
Añade tipos de parámetros y de retorno a una función.
function formatPrice(
amount: number,
currency: string
): string {
return `${currency} ${amount.toFixed(2)}`;
}
const total = formatPrice(24.5, "USD");