A generic type parameter preserves a relationship across a function's inputs and outputs. A first-element helper should return the same element type it received, with undefined added for an empty list. A key lookup can connect the chosen key to the object's own type through keyof and indexed access. Constraints let a generic function use a known capability, such as a length field, without forcing every caller into one concrete type. Keep the relationship as narrow as the behavior permits. Returning any would hide mistakes from the caller. The compiler assertions in this lesson try valid calls and calls that must be rejected, while runtime tests check order and empty inputs.