TypeScript | Generics in TypeScript | Question5

Last Updated :
Discuss
Comments

What is the purpose of constraints in generics?

To limit the use of generics to specific classes only.

To enforce that a type parameter meets certain requirements

To ensure that generics cannot be used in functions.

To restrict the number of type parameters in a function.

Share your thoughts in the comments