TypeScript:
TypeScript is a typed superset of JavaScript that compile to plain JavaScript.
Topics:
1. Getting Started with TS
2. Typing, Variables & Functions
3. Classes & Interfaces
4. TypeScript Modules
Why TypeScript?
Before why we need to understand the problems with writing JavaScript code.
1. JavaScript is messier with un-maintained code.
2. Enterprise-code is very complex and difficult to use proper types.
3. Difficult to work on 1000’s lines of JavaScript code.
4. Create variables as integers and below of the code it can be used as string in JavaScript.
To avoid these kind of JavaScript issues, TypeScript is introduced.
Is there any TypeScript Alternatives?
1. DART (By Google)
2. CoffeeScript
3. eCma Script
TypeScript Features:
TypeScript works with
1. Any Browser
2. Any Host
3. Any Os
4. Open Source
TypeScript Tool / Framework Support
TypeScript support by many modern tools ex..
2. Visual Studio
3. Visual Code
5. eXma
Declaration and Annotation
//any:
var data : any = ‘Siva’;
var details : any = 123;
//strings:
var Name : string = ‘Siva’;
var FirstName : string = ‘Kakarla’;
//array:
var names : string[] = [‘Siva’, ‘Rama’, ‘Krishna’, ‘Venkata’];
var Ages : number[] = [21,22,23,24];
//null:
var SaleDetails : any = null;
var DateOfSale : Date = null;
var Quantity : number = null;
//undefined:
var quantity : number;
var company : any;
Comments
Post a Comment