Generic Type (T) vs Any in TypeScript #typescript #javascriptdeveloper #reactdeveloper

preview_player
Показать описание
What's the difference between using a generic type (T) vs any in TypeScript?

📣 Follow Coding in Flow on social media:
Рекомендации по теме
Комментарии
Автор

You didn't even need to set the type explicitly when you used the useAutoSave hook. Got me confused for a sec, but it works, interesting.

raging_cloud
Автор

Do you have any plans for an updated MERN Stack course on youtube with NextJS, TailwindCSS ? If yes then when?

bhargavkumar
Автор

There seems to be a very faint background music that plays when you start explaining the generic type, not that I'm complaining 😊

BeeBeeEight
Автор

This is somewhat misconceived. You should compare generics to 'unknown' which is the type used to take any type.
'any' is a special type which disables type checking - it should only be used in special situations where that is desired. Your T type will be a type that is within the 'unknown' set.

robertsandiford
Автор

Haben wir noch deuschen Akzent?
Dieser Dude: hold my Weißwurst

Rysr