TypeScript · Types and shapes
Function type
Describes a function signature, including parameters and return type.
Syntax
(a: number) => stringExample
Example
type Formatter = (value: number) => string; const format: Formatter = value => value.toFixed(1);
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.