easyExtra#92

TypeScript generics — identity function

Prompt

Write a generic identity function that returns the same type it receives. Use it with a string and a number relying on inference, and once with an explicit type argument.

Hints

Solution

Your Code

5 min

Tests

Click Run to test your code