TypeScript Functions
Function Types
Typing the function
1 | function foo(x: number, y: string): string { |
Writing the function type
1 | let foo: (x: number, y: string) => string = function ( |
Inferring types
1 | let foo: (x: number, y: string) => string = function (x, y) { |