Beginner TypeScript
Q11 / 100

Which of these is a valid TypeScript union type declaration?

Correct! Well done.

Incorrect.

The correct answer is B) let id: number | string;

B

Correct Answer

let id: number | string;

Explanation

The pipe symbol "|" is used to declare a union type, meaning the variable can hold either type.

Progress
11/100