Engrain by ByteRush

TS.05 4 concepts · 3 ready

Type operators

Build types from other types.

  1. TS.05.01keyof, typeof and indexed access typesCoreMid-level9 min
  2. TS.05.02Conditional types and inferCoreMid-level11 min
  3. TS.05.03Mapped types and key remappingCoreMid-level10 min
  4. TS.05.04Template literal typesMid-levelBeing written

Interview questions in this module

  1. What is a conditional type? What does "distributive" mean?
  2. How does infer work? Implement ReturnType.
  3. What is a mapped type? Implement Readonly<T>.
  4. Extract route parameters from "/users/:id/posts/:postId" as a type.
  5. How do you get a union type from an array of string constants?