TypeScript Basics
Core Concepts & Fundamental Syntax
Basic Types
Primitive Types
The building blocks of TypeScript
.ts
Type Inference
TypeScript is Smart
It can often figure out types automatically
.ts
When to Be Explicit
Sometimes you need to specify types
.ts
Union Types
Multiple Possible Types
When a value can be one of several types
.ts
Pro Tip: TypeScript"s control flow analysis automatically narrows union types based on your conditional checks!
Type Aliases vs Interfaces
Type Aliases
Creating reusable type definitions
.ts
Interfaces
Defining object contracts
.ts