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

Unknown vs Any

  • When unsure of a type, use unknown instead of any in TypeScript.
  • unknown forces explicit type checks before usage, improving type safety.
INSIGHT

Never Type

  • The never type in TypeScript ensures mutually exclusive properties in components.
  • This helps create distinct use cases based on property presence.
INSIGHT

Definition Files

  • Definition (.d.ts) files provide TypeScript definitions for JavaScript libraries.
  • These files are helpful for older projects or globals like window.
Get the Snipd Podcast app to discover more snips from this episode
Get the app