Question-8

Last Updated :
Discuss
Comments

How can you declare a variable of type string or number in TypeScript?

let value: string | number;

let value: string & number;

let value: any;

let value: union<string, number>;

Tags:
Share your thoughts in the comments