SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

TypeScript

» Start this Course
(Practice similar questions for free)
Question:

How would you rewrite this function to be generic without using "any"? function identity(arg: any): any { return arg }

Author: John Pencola



Answer:

By using generic type-parameters function identity<T>(arg: <T>): <T> { return arg }


0 / 5  (0 ratings)

1 answer(s) in total