ਨੈੱਟ WPM0
WPM0
ਸ਼ੁੱਧਤਾ100%
ਬੀਤ ਗਈ0s
ਸਮਾਂ—
ਅੱਖਰ0
ਗਲਤ0
ਗਲਤੀਆਂ0
ਪ੍ਰਗਤੀ0%

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");