MediumConceptTypeScript in depth
What are generics and why use constraints?
What a good answer covers
Generics let a function or type work over many types while preserving the relationship between them. Constraints with extends limit the allowed types so you can safely use their properties.