Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
TypeScript is a typed superset of JavaScript that complies to plain JavaScript.
The TypeScript compiler takes care of this compiling job.
You need to install the TypeScript in the local npm package of your project or in the Global npm package.

h2. Installing TypeScript

There are two main ways to get the TypeScript tools:

1. Via npm (the Node.js package manager)
  npm install -g typescript
  Follow the link here for a detail 

2. By installing IDE TypeScript plugins.
 I recommend using the Visual Studio Code for TypeScript project. VS Code provides many features for TypeScript out of the box, however there are several more extensions out there for more functionalities.


h2. Configurations


h2. Why use TypeScript?
A Large JavaScript Project is difficult to maintain if proper coding patterns are not followed.
TypeScript is built for large Enterprise scale applications. 
TypeScript makes the code more modular, therefore more mentainable and easy to make future code changes.

h2. JavaScript vs TypeScript
Dynamically Typed Language, | 
- Variable can hold any type of oject/values
  (example) - var anyObject = false;
              var anotherAnyType = "Any string value";
- Type is determined during the value assignment
  (example)
- Implicit Type Coercion (conversion) https://dev.to/promhize/what-you-need-to-know-about-javascripts-implicit-coercion-e23
  (example)

-Bad part: Difficult to ensure correct types are passed without proper testing
 - Huge code bases are difficult to maintain without proper design patterns in place


 h2. There are several TypeScript Alternatives to te above limitations
  - Write good quality JavaScript code and apply proper design patterns
  - CoffeeScript from official site: https://coffeescript.org/
  - Learn Dart : https://www.dartlang.org/