What is Typescript

Diana ponce
2 min readNov 8, 2020

TypeScript is an open-source language and compiler which builds on JavaScript, it takes the javascript language and adds new features to it. It is a different and new way for us to write out our javascript code and makes it easier ! TypeScript code is not executed by javascript environments like the browsers. When the code is written in TypeScript it is then compiled and translated into JavaScript which then helps browsers to read the code and for it to be displayed.

Difference between Typescript and javascript

  • TypesScript is known as Object oriented programming language but JavaScript is a scripting language.
  • TypeScript provides us a feature which is static typing , through type annotations to enable type checking at compile time but JavaScript does not have this feature, Javascript is dynamically typed.
  • TypeScript gives support for modules but JavaScript does not support modules.
  • TypeScript has Interface but JavaScript does not have Interface.

Above we talked about how TypeScript uses static typing. This means when Variables are declared they can be given a type. TypeScript will check types at compile time, and if the variable has a value different from the type its given it will throw an error.Even though there is an error thrown this does not prevent the code from running and being executed. TypeScript goes through the code and checks( like it spellchecks ) the code for you. It will let you know when something looks off, but it won’t change how your code runs.

Typescript is very easy to learn mostly if you know the basics of javascript, in the next medium post i will be giving a small tutorial on using Typescript!

--

--