01 / 05
A function type looks like a function
A function is a value too, so it has a type. The writing looks very like a function itself — inside the brackets are the parameter types, right of the arrow is the return type.
The double below is a variable that holds "a function taking a number and returning a number".
const double: (n: number) => number = (n) => n * 2;console.log(double(6));Result
12