I started exploring TypeScript when I started my experimentation with Angular2. Angular2, one of the awesome front end developer frameworks out there by Google, which is taking the front end web development world by storm. I started my experimentation with Angular2 during one of my projects. As soon as I entered the Angular 2 website, I was caught up with the work TypeScript. I got a bit curious on knowing what this is all about. So I started exploring.
So, what is TypeScript?
- No Class keyword. Still classes are there in the language
- Function represent both classes and functions based on the context in which they are used
- Functions can be assigned to variables and behave as variables
- No well-defined package and module based programming patterns
- Inheritance, Polymorphism parts are very tricky and very confusing for new comers from other OOPS languages
Features of TypeScript
- Strict type checking to detect data type related errors during the development phase itself rather than during the runtime which is a huge time saver
- Class based programming style which is prevalent among other OOPS languages like Java, .NET, PHP, Python etc.
- Ability to opt in and out of type checking which avoids some problems in the case of working with external third party libraries.
Setting it up
npm install -g typescript