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.

What 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.

  1. 01TypeScript Intro
  2. 02Get Started
  3. 03TypeScript Syntax
  4. 04TypeScript Output
  5. 05TypeScript Comments
  6. 06TypeScript Variables
  7. 07User Input
  8. 08Data Types
  9. 09TypeScript Operators
  10. 10TypeScript Strings
  11. 11TypeScript Math
  12. 12TypeScript Booleans
  13. 13If Else
  14. 14TypeScript Switch
  15. 15While Loop
  16. 16For Loop
  17. 17Break Continue
  18. 18TypeScript Arrays
  19. 19TypeScript Objects
  20. 20TypeScript Enums
  21. 21Type Aliases
  22. 22Union Types
  23. 23TypeScript Functions
  24. 24Function Parameters
  25. 25Overloading
  26. 26TypeScript Recursion
  27. 27TypeScript OOP
  28. 28Classes Objects
  29. 29Class Methods
  30. 30Constructors
  31. 31Access Specifiers
  32. 32Encapsulation
  33. 33Inheritance
  34. 34Polymorphism
  35. 35TypeScript Modules
  36. 36Exceptions
  37. 37Array Methods
  38. 38Strict Null
  39. 39TypeScript Examples
  40. 40Ternary Operator
  41. 41Nested Loops
  42. 422D Arrays
  43. 43TypeScript Const
  44. 44Namespaces
  45. 45Getters Setters
  46. 46Type Assertions
  47. 47TypeScript Generics
  48. 48Utility Types
  49. 49TypeScript Map
  50. 50TypeScript Set
  51. 51Algorithms
  52. 52TypeScript Lambdas
  53. 53TypeScript Dates
  54. 54TypeScript Static
  55. 55Abstract Classes
  56. 56Interfaces

FAQ: TypeScript Tutorial

Common questions about this page.

What is the StudyGrid TypeScript tutorial?

The StudyGrid TypeScript tutorial follows the same chapter rhythm as C++: syntax, types, input, loops, functions, classes, generics, maps, and lambdas. Each chapter has copy-and-run examples.

Should I run typescript tutorial examples locally for better learning?

Yes. Use the browser editor on StudyGrid for a quick check, then Download the example and run it on your computer. Local runs show real errors and the real toolchain, which is one of the fastest ways to learn typescript tutorial in this TypeScript TypeScript lesson (TypeScript Tutorial).

Is the TypeScript editor the same as Try Python or Try C++?

No. Try TypeScript type-checks with tsc at /typescript/try and shows stdout plus compiler messages. Try Python stays at /try. Try C++ stays at /cpp/try. TypeScript lessons never open those editors.

Do I need to install a compiler to learn TypeScript?

No. Open a chapter, click Try it in TypeScript, and compile in the browser. You can also download a .ts file and compile locally with tsc.

Where should I start the TypeScript tutorial?

Start at TypeScript Intro, then Get Started and Syntax. After the first program, continue to output, variables, and if-else. After classes, open TypeScript Examples, then generics, Map, and arrow functions. Use Next at the bottom of each chapter.

Is the TypeScript tutorial free?

Yes. The TypeScript workshop on StudyGrid (studygrid.in) is free: dashboard, chapters, and the compile-and-run editor.