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.
Check types asks the compiler to read your file. It lists each type error with its line. Your code does not run. The exercise is solved when there are no type errors.
Starter code
or press Ctrl EnterNot run yet
type check
Not run yetprice.ts
Expected result: no type errors.