Type a helper from its calls

Use existing calls to determine a helper’s types.

your task

Add parameter and return types to formatPrice. Keep the function body. Both valid calls must compile and both marked calls must be rejected.

TypeScript reports both parameters of formatPrice. In caller.ts, one valid call supplies a currency and another leaves it out. The two calls marked @ts-expect-error must be rejected.

Starter code
or press Ctrl EnterNot run yet

type check

Not run yetprice.ts

Expected result: no type errors.