TypeScript · Junior · Question 4 of 75

What does the never type mean?

Explanation

never is the empty type. It's returned by functions that always throw or loop forever. It also appears when a union is fully narrowed - exhaustive switch checks are built on this. void means the function finishes but its result isn't used.

Further reading

Problem with a question

TypeScript · Junior · question 4

Test yourself

Take the TypeScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz