Alias the Callback
Function type expressions can also be aliased. Giving a name to a callback shape makes code easier to read and reuse. Keep parameter and return types explicit.
- Name a function type for clarity (e.g., (n: number) => string).
- Map an array without mutating the original.
- Return a new array of formatted strings.
Your Task
- Define type Stringifier = (n: number) => string.
- Implement formatAll(nums: number[], fmt: Stringifier): string[] that maps each number using fmt.