typescript use generic type as return value code example Example: typescript generic type function identity<T>(arg: T): T { return arg; }Try