I need to declare a variable:
Id: string | string[] | undefined;
But I'm facing an error
TS2304: Cannot find name 'undefined'.
Even though Basic Types states that undefined
is a valid type in TypeScript.
Advanced Types explores union types like number | undefined
.
What could be the issue with my union type declaration?