Episode 1 of 21

Introduction & Setup

What is TypeScript, why use it, and how to set up your development environment.

Introduction to TypeScript

TypeScript is a superset of JavaScript developed by Microsoft. It adds optional static typing on top of JavaScript, making it easier to build and maintain large-scale applications.

Why TypeScript?

  • Static type checking — catch bugs at compile time, not runtime
  • Better IDE support — auto-completion, refactoring, inline docs
  • Easier to maintain — types serve as documentation
  • Modern JS features — use future JavaScript today

TypeScript vs JavaScript

FeatureJavaScriptTypeScript
TypingDynamicStatic (optional)
CompilationInterpretedCompiled to JS
Error detectionRuntimeCompile time
IDE supportBasicExcellent

Setting Up

Install TypeScript globally:

npm install -g typescript
tsc -v   # Check version

Create your first file — sandbox.ts:

let character = "Mario";
let age = 30;
let isBlackBelt = false;

console.log(character, age, isBlackBelt);

TypeScript infers types from assigned values:

character = "Luigi";   // OK
character = 20;        // Error! Type 'number' is not assignable to type 'string'

Key Takeaways

  • TypeScript = JavaScript + static types
  • It compiles down to plain JavaScript
  • Types are inferred automatically from assigned values
  • Install with npm install -g typescript