← Fullstack with Vue.jsQuestion 25 of 62
Why use generics instead of any?
📘 Explanation
Generics preserve specific type information through your code, so TypeScript can still check types correctly, whereas any discards all type information and loses that safety. Generics don't affect runtime performance, don't skip type checking, and are not tied to compatibility concerns—those claims don't reflect what generics actually do.
Related questions
← PreviousNo login needed