Type Script
Type Script is simply a superscript of java-script. Or an improved form of java-script. It has additional features that are not available in java-script. This means any valid java-script code is actually in type script as well; only that because of the additional features in it, some code in type script will not be available in java-script.
Look, what are the major differences between type script and java-script?
Type script comes with objected oriented featured that are not in java-script.
In type script you can catch error at compilation time and not at run time like in java-script.
How do browsers understand type script?
Browsers do not understand type script. But they do understand java-script. As a result, during type script compilation the a java-script is created. This is the script that the browsers will understand. So in short, type script is there to make programming a little friendlier compared to java-script codes. The process of creating the java-script from type script is termed transpiling.
So whenever we build our type script program, the type script compile comes into play and transpiles the script to java-script. Let us differentiate between compiling and transpiling here.
How do we install tyoescript?
On windows command shell type npm install -g typescript
and if you are using mac then using sudo npm install -g typescript
where -g in the command means global. Your command window should look somewhat below upon installation.
You will be prompted with the version of type script that has been installed. Like in my case it is version 3.5.1