Syntax - Tasty Web Development Treats

TypeScript Fundamentals — Getting a Bit Deeper

Apr 28, 2021
Dive into the complexities of TypeScript as the hosts explore advanced concepts like the differences between 'any' and 'unknown' types. Learn about declaration files and how type generation can streamline data management from APIs like GraphQL. Discover the significance of web accessibility with tools like Axe DevTools to seamlessly address issues. Plus, get insights into the transition from JavaScript to TypeScript, along with the distinctions between types and interfaces. Finally, enjoy light-hearted chatter about rechargeable batteries and innovative toothbrush technology!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Type Assertion

  • Use type assertion (as) to override TypeScript's inferred types.
  • This acts as an escape hatch when TypeScript struggles with inference.
INSIGHT

JSDoc for Typing

  • JSDoc comments allow for typing and documenting JavaScript code simultaneously.
  • This offers TypeScript-like benefits without fully adopting TypeScript.
ADVICE

Interfaces vs. Types

  • Default to using interfaces in TypeScript, then try types if needed.
  • Both are similar, but interfaces often compile faster.
Get the Snipd Podcast app to discover more snips from this episode
Get the app