Generics leave a type parameter in a function instead of fixing one concrete type. The input selects a type, and that same relationship carries to the output.
The demo alternates number and string through one identity template. Add a type parameter when it connects positions, rather than as decoration.
When to use
Use it when a collection or transform function must preserve a relationship between input and result types.