TypeScript Associate — Hard
Key points
- TypeScript infers the type of generics based on the argument passed
- In this case, since 42 is a number, T is inferred as number
- This results in the function returning a number type
Ready to go further?
Related questions
