Deviopath › TypeScript

Optional Properties

Easy · Interfaces

The Product interface has an optional discount (a percentage from 0 to 100).

Write finalPrice(product: Product): number that returns the price after the discount. If there is no discount, return the original price.

Next: Display Name with ??