Function Parameters
Parameters
π¨βπΌ We need utility functions for our e-commerce platform. Let's focus on
functions that accept clear inputs and return the right type.
π¨ Open
and create these functions:
calculateTax(amount: number, rate: number)- Returns the tax amountformatPrice(cents: number)- Converts cents to dollar string (e.g., 1999 β "$19.99")applyDiscount(price: number, discountPercent: number)- Returns discounted price
Return values are already familiar from 5.1βfocus on parameter types here,
but keep the return types explicit too.


