A comprehensive, hands-on introduction to TypeScript basics, custom types, unions, and defensive coding.
This course is a hands-on introduction to TypeScript. You'll learn how TypeScript can make your life easier and your code less error-prone.
✏️ Study this course interactively on Scrimba:
v2.scrimba.com/learn-typescript-c03c?utm_source=youtube&utm_…
Code is available on the Scrimba course page for each lesson.
Scrimba on YouTube: youtube.com/c/Scrimba
⭐️ Course Contents ⭐️
Introduction
Intro to Pizza app
Move code to TS
Defensive coding
Obligatory types basics lesson
Add type to orderId
Defining Custom Types
Adding a Pizza type
Nested object types
Optional properties
Adding an Order type
Typing arrays
Type orderQueue
Literal types
Unions
Update order status to use literal type unions
Add ids to pizzas
Type Narrowing
Be explicit whenever you can
Function return types
TS-specific types: any
Add return type to getPizzaDetail
Void return type
Add automatic ids to menu items
Utility Types & Partial
Omit Utility Type
Fix TS warnings with Omit
Generics
Generic functions in the pizza restaurant
Explicitly type generic function calls
Conclusion... for now
🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama
--
Learn to code for free and get a developer job: freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news
❤️ Support for this channel comes from our friends at Scrimba – the coding platform that's reinvented interactive learning: scrimba.com/freecodecamp
Why it's here
2 people recommend this
What people say. Recommended as a great video tutorial for beginners jumping straight into TypeScript.
m
u/mkvlrnin r/typescript • Recommends
On “Getting into typescript with no prior JS experience”
> Is it worth to learn JS before TS?
No.
> Or can I just jump into TS?
Yes.
> Any good resources for learning
Way too goddamn many, try this if you're a video person: link to this video