Function parameters and return types can both be annotated. Optional parameters use `?` and must come after required ones; default parameters supply a fallback and their type is inferred from the default.
ts
function mint(to: string, amount: number, memo?: string): boolean {
return amount > 0;
}
function fee(gwei: number, multiplier: number = 1.1): number {
return gwei * multiplier;
}Arrow functions type the same way: `const add = (a: number, b: number): number => a + b;`. If you omit the return type, TypeScript infers it from the function body — a good habit for internal helpers, while public APIs benefit from explicit return types for documentation and stability.