Engrain by ByteRush

TS.03.03 Mid-level

Generic inference in depth

Comes up in: Coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • where inference comes from
  • contextual typing
  • const type parameters
  • NoInfer<T>
  • why inference widens
  • designing generics with few type parameters

Words you will know

contextual typinginference siteconst type parameter

What you will practise

  • fix 4 badly inferred generic APIs

Interview questions this answers

  • What does NoInfer do?