TypeScript-101

Jagadhiswaran D
2 min readJul 20, 2022

Typescript was developed by microsoft in 2012 in which it was first appeared. It was a open source and superset of javascript.The main features of typescript are it comes with the addition of class based object-oriented programming and static type checker.It is developed to tackle the problems dealing with the large level application created using javascript.

What is Static Type Checker?

Static Type Checker in typescript is useful in detecting error in code without running it is referred as Static Checking.It can also be said in a simpler way that errors in the code are detected before executing the code.

Features of Static Type Checker:

  1. It is designed to allow the correct programs through while still catching as many error possible.
  2. Typescript never changes the runtime behaviour of the javascript code
  3. Once Typescript Compiler Is done with the checking it erases the types when compiling the resulting code.
  4. Typescript does not provide any runtime libraries
  5. Typescript is a Javascript’s Runtime with Type Checker Compiler.
TypeScript Code
Compiled Javascript Code

Output of the code:

hello typescript

27

{‘100’:10}

Using Strict enables the code to execute in strict mode.

All javascript Programs are typescript programs once types are added to it.This helps mostly in the large application to avoid the data type error in the runtime and make the code more efficient and improves the performance of the application.

--

--

Jagadhiswaran D

Front-end Developer | JavaScript Developer | Web Developer | Software Engineer | Blockchain Ethusiast | Web3.js | Ethereum |