Type Variable
A type variable is the placeholder for a generic type in your generic code:
1 |
|
Type variables are written by using the angle brackets and defining a name for the variable (e.g. <T>
). This construct is often referred to as the diamond operator because the angle brackets look like a diamond (<>
, 💎).