TypeScript · Middle · Question 24 of 75

What does NonNullable<string | null | undefined> return?

Explanation

NonNullable<T> excludes null and undefined from a union. It's currently implemented as T & {}. Handy for values after a check or in filter results.

Further reading

Problem with a question

TypeScript · Middle · question 24

Test yourself

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

Take this quiz