2. • Typed SuperSet of JavaScript
• Any Existing JavaScript Script/ program is also a valid TypeScript
• Adds typing
• No Special Runtime
• Transpiles to JavaScript
TypeScript
3. • Early detection of Bugs
• Auto-Complete/ Intellisense
• Adds typing
• No Special Runtime
• Transpiles to JavaScript
Benefits of a Typed Language
8. You will love TypeScript if:
• Love C# or Java and find JS quite vague
• You mostly use Visual Studio or VS Code for Refactoring Support
• You like when you catch lot of your bugs by Type-Checking
9. How TypeScript Works?
• TypeScript File: main.ts
• > tsc main.ts main.js
• tsc main.ts -sourcemap main.js + main.js.map
Map files are used to debug TypeScript files instead of
JavaScript directly.
23. Two types of Encapsulation Containers
• Modules
• Namespaces
24. Modules
• Way to Group Code
• The file is the Container
• Other files have to import
• No reference path needed
• TypeScript relies on a Module Loader to load the modules.
• For bigger projects you need an External Module Loader.
• Loaders: RequireJS, CommonJS, SystemJS … etc.
28. Modules vs Namespaces
• Tool for organizing code
• Native Support in Node.js
• Browsers supported with Module
Loaders
• Code re-use
• Tool for organizing code
• No special loader needed
• Prevents Global namespace
Pollution
• Best for small applications
Modules Namespaces
Module wins the verdict for bigger project