As someone who is new to Typescript, I recently came across the following syntax:
interface Foo {
// what does age signify and
// what if it is not optional i.e () => string, age:number;
(): () => string, age?: number;
}
From what I gathered, Foo is an interface for a function where any function implementing Foo must return another function that returns a string.
However, I am still unsure about the purpose of age?: number.