Generics
Generic functions
With Generics, you can create functions with types as parameters. Instead of writing separate functions for each type like:
you can write a function with a type parameter:
You can call a generic function like any other function:
Last updated