TypeScript tutorial
Write TypeScript, check the types, then run it.
Types, functions, classes, and generics. The editor uses tsc, then runs the JavaScript. Try it Yourself opens /typescript/try.
56 chapters. The editor is /typescript/try.
Topics
Start at intro, or jump to types, classes, or projects.
Start
Compile your first program
Intro · Syntax · OutputData
Types, strings, and input
Variables · Types · StringsControl
Decisions and loops
If · While · ForTypes
Shapes, unions, and aliases
Arrays · Objects · UnionsFunctions
Reuse work without copy-paste
Functions · OverloadOOP
Classes, inheritance, abstract
Classes · Inherit · interfaceAdvanced
100+ programs to compile
Examples · Generics · MapProjects
Ten programs you can finish
Bank · Library · CartBootcamp
Question, hint, solution, Check
Labs · Hints · tsc CheckWhat you get in this tutorial
- tsc, then run. The right pane is stdout and type errors.
- Its own editor. Lessons are under /typescript. The compiler is /typescript/try.
- A chapter path. Change the source, compile, press Next.
All chapters
Every chapter, in order.
- 01TypeScript Intro
- 02Get Started
- 03TypeScript Syntax
- 04TypeScript Output
- 05TypeScript Comments
- 06TypeScript Variables
- 07User Input
- 08Data Types
- 09TypeScript Operators
- 10TypeScript Strings
- 11TypeScript Math
- 12TypeScript Booleans
- 13If Else
- 14TypeScript Switch
- 15While Loop
- 16For Loop
- 17Break Continue
- 18TypeScript Arrays
- 19TypeScript Objects
- 20TypeScript Enums
- 21Type Aliases
- 22Union Types
- 23TypeScript Functions
- 24Function Parameters
- 25Overloading
- 26TypeScript Recursion
- 27TypeScript OOP
- 28Classes Objects
- 29Class Methods
- 30Constructors
- 31Access Specifiers
- 32Encapsulation
- 33Inheritance
- 34Polymorphism
- 35TypeScript Modules
- 36Exceptions
- 37Array Methods
- 38Strict Null
- 39TypeScript Examples
- 40Ternary Operator
- 41Nested Loops
- 422D Arrays
- 43TypeScript Const
- 44Namespaces
- 45Getters Setters
- 46Type Assertions
- 47TypeScript Generics
- 48Utility Types
- 49TypeScript Map
- 50TypeScript Set
- 51Algorithms
- 52TypeScript Lambdas
- 53TypeScript Dates
- 54TypeScript Static
- 55Abstract Classes
- 56Interfaces