Skip to content

TypeScript Generics

Generic functions, generic constraints and conditional types

advanced
Question 1 of 7
Question 1 of 7typescript

Which of the following generic function signatures is correct?

typescript
function identity<T>(arg: T): T {
  return arg
}