Skip to content
Ryan Lee edited this page Dec 28, 2022 · 1 revision
  1. Why do we use T extends T everywhere? Doesn't this case always resolve to true?

T extends T forces the type resolution to use a distributive conditional type for arrays. i.e. it will output string[] | number[] instead of (string | number)[].

Clone this wiki locally