...

/

Generic Functions

Generic Functions

Learn how to work with generic functions and use type parameters.

Type parameters

Just as we can pass an argument value to a parameter, we can pass a type as a type argument. For this, a function needs to define one or more type parameters inside <> brackets immediately after the fun keyword.

Tip: By convention, type parameter names are capitalized. ...