If I have multiple functions that return either a number or a date, is there a way to define a type that encompasses both?
For example, instead of:
foo1(): number | Date {}
foo2(): number | Date {}
Can we do something like this:
foo1(): NumberOrDate {}
foo2(): NumberOrDate {}
Is there a better approach to avoid repeating 'number | Date' and stay DRY?