Concept Flow - How TypeScript infers generic types
Call generic function with argument
TypeScript checks argument type
Infer generic type from argument
Use inferred type inside function
Return or process value with inferred type
TypeScript looks at the argument you pass to a generic function and figures out the generic type automatically, so you don't have to specify it.