Intermediate
TypeScript
Q41 / 100
What is a generic function in TypeScript?
Correct! Well done.
Incorrect.
The correct answer is B) A function that works with a variety of types while preserving type relationships
B
Correct Answer
A function that works with a variety of types while preserving type relationships
Explanation
Generics, e.g. "function identity<T>(arg: T): T", allow functions to operate on multiple types while keeping type safety.
Progress
41/100