Intermediate TypeScript
Q62 / 100

What is the difference between "unknown" and "any"?

Correct! Well done.

Incorrect.

The correct answer is B) unknown requires type-checking or narrowing before performing operations on it, while any bypasses all checks

B

Correct Answer

unknown requires type-checking or narrowing before performing operations on it, while any bypasses all checks

Explanation

unknown is a type-safe counterpart to any: you must narrow or assert its type before using it, preventing accidental unsafe operations.

Progress
62/100