20140112 Top 10 things to know about TypeScript

17
Top 10 things to know about TypeScript By Anney

description

Top 10 things to know about TypeScript

Transcript of 20140112 Top 10 things to know about TypeScript

Page 1: 20140112 Top 10 things to know about TypeScript

Top 10 things to know about TypeScript

By Anney

Page 2: 20140112 Top 10 things to know about TypeScript

04/12/2023 2

1. TypeScript Code is Converted into Plain JavaScript Code

Page 3: 20140112 Top 10 things to know about TypeScript

04/12/2023 3

2. Data Types

Page 4: 20140112 Top 10 things to know about TypeScript

04/12/2023 4

3. Classes

Page 5: 20140112 Top 10 things to know about TypeScript

04/12/2023 5

4. Access Modifiers and Properties

Page 6: 20140112 Top 10 things to know about TypeScript

04/12/2023 6

Testing 1

• Create a class named MyCar.

• MyCar has four members viz. _sn, DoorNumber, Color, Run are declared of type number, number, string, and void function. _sn maked as private.

• Finally, create mycar instance with MyCar class.

Page 7: 20140112 Top 10 things to know about TypeScript

04/12/2023 7

TypeScript Command Line

Page 8: 20140112 Top 10 things to know about TypeScript

04/12/2023 8

5. Static and Instance Members

Page 9: 20140112 Top 10 things to know about TypeScript

04/12/2023 9

6. Function Overloading

Page 10: 20140112 Top 10 things to know about TypeScript

04/12/2023 10

7. Constructors

Page 11: 20140112 Top 10 things to know about TypeScript

04/12/2023 11

Testing 2

• Declare a parameterized constructor for MyCar Class. The constructor has two parameters viz. doorNum, color are declared of type number, string and inside the constructor their values are assigned to repective properties.

• Finally, create mycar instance with MyCar class.

Page 12: 20140112 Top 10 things to know about TypeScript

04/12/2023 12

8. Inheritance

Page 13: 20140112 Top 10 things to know about TypeScript

04/12/2023 13

Testing 3

• Create a class named Car.

• Car has a member - Name is declared type of string.

• Declare a parameterized constructor for Car Class. The constructor has a parameter - name is declared of type string and inside the constructor it value is assigned to repective property.

• Make MyCar class inherits from the Car class.

• Finally, create mycar instance with MyCar class.

Page 14: 20140112 Top 10 things to know about TypeScript

04/12/2023 14

9. Interfaces

Page 15: 20140112 Top 10 things to know about TypeScript

04/12/2023 15

10. Modules

Page 16: 20140112 Top 10 things to know about TypeScript

04/12/2023 16

References

• Top 10 things to know about TypeScript

• http://www.developer.com/lang/top-10-things-to-know-about-typescript.html

Page 17: 20140112 Top 10 things to know about TypeScript

04/12/2023 17

~ THE END ~