Shift + Enter · Mulai / mulai ulang
Baca panduan cepat kode
- Bahasa Pemrograman
- TypeScript
- Kesulitan
- Mudah
Add parameter and return types to a function.
function formatPrice(
amount: number,
currency: string
): string {
return `${currency} ${amount.toFixed(2)}`;
}
const total = formatPrice(24.5, "USD");