Code QuizAdvanced

Extracting Array Element Type

The infer keyword introduces a type variable to capture part of a matched type.

Codetypescript
type ElementType<T> = T extends U[] ? U : T;

type A = ElementType<string[]>; // want string

What is the bug in this element-extracting type?