Shift + Enter · ప్రారంభించండి / పునఃప్రారంభించండి
కోడ్ ప్రాంప్ట్ గైడ్ని చదవండి
- ప్రోగ్రామింగ్ లాంగ్వేజ్
- TypeScript
- కష్టం
- సులభం
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");