Web Development TypeScript Mcq
Oct 04, 2025

What is the correct way to define a generic function in TypeScript?

Choose the correct answer:
A) function identity<T>(arg: T): T { return arg; }
B) function identity(T)(arg: T): T { return arg; }
C) function identity[T](arg: T): T { return arg; }
D) function identity{T}(arg: T): T { return arg; }
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback