cf.completefrontend

Predict the typesEasy

What do Exclude, Extract, and NonNullable produce for these types?

Name the type each ^? line points at, and say whether TypeScript reports any errors.

What does TypeScript report here?
type UiEvent =  | { type: "click"; x: number }  | { type: "key"; key: string }  | { type: "scroll" }; type Letters = Exclude<"a" | "b" | "c", "a" | "x">;//   ^?type Input = Extract<UiEvent, { type: "click" | "key" }>;//   ^?type Name = NonNullable<string | null | undefined>;//   ^?type Text = Exclude<string, "">;//   ^?

Work it out first: the compiler shows every error and type.

The answer

Work out every error TypeScript reports and every type it shows, line by line. Then check.

Checking your sign-in…