MENU

Fun & Interesting

TypeScript Interfaces vs Types

Harry Wolff 89,202 lượt xem 4 years ago
Video Not Working? Fix It Now

I’m answering one of the most asked questions from my last video: What should I use? TypeScript Interface or Type?

It’s a great question, and one I greatly struggled with when I first started learning TypeScript.

Ultimately my advice is simple: use interfaces for objects, and types for everything else.

If you want the longer answer, check out the video.

——

NEWSLETTER: https://tinyletter.com/hswolff/subscribe

PATREON: https://www.patreon.com/hswolff

TWITTER: https://twitter.com/hswolff

SITE: https://hswolff.com/

Comment