A function type describes parameter types and the return type. Optional means the argument may be missing. When an optional value is missing, choose a simple default.
You will write a small greeter with an optional repeat count. Keep the output stable and avoid side effects.
type Printer = (msg: string, times?: number) => string;
Define a function type and implement a greeter with an optional count.