WPM thực0
WPM0
Độ chính xác100%
Đã qua0s
Thời gian—
Ký tự0
Sai0
Lỗi0
Tiến độ0%

Shift + Enter · Bắt đầu / bắt đầu lại

Đọc hướng dẫn đoạn mã
Ngôn ngữ lập trình
TypeScript
Độ khó
Dễ

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