Skip to content

Commit a95ebb3

Browse files
committed
Remove explicit return type from processPayment
Let TypeScript infer the return type from the method call.
1 parent 1169e7c commit a95ebb3

File tree

1 file changed

+1
-1
lines changed
  • exercises/03.interfaces-and-classes/02.solution.programming-to-abstractions

1 file changed

+1
-1
lines changed

exercises/03.interfaces-and-classes/02.solution.programming-to-abstractions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class PayPal implements PaymentMethod {
2929
}
3030

3131
// ✅ Function accepts interface type, not concrete class
32-
export function processPayment(method: PaymentMethod, amount: number): string {
32+
export function processPayment(method: PaymentMethod, amount: number) {
3333
return method.pay(amount)
3434
}
3535

0 commit comments

Comments
 (0)