TypeScript | Type Aliases | Question9

Last Updated :
Discuss
Comments

What will be the output of the following code?

TypeScript
type ID = string | number;
let userID: ID = 42;


42

"42"

undefined

Compilation erro

Share your thoughts in the comments