What should we use Javascript or Typescript?

Manish Kumawat
2 min readNov 2, 2020

When I started development I used javascript to make web pages interactive. And at that time I loved it as it is both frontend and backend friendly.
Now recently I came across the typescript during my project. As you know time changes everything and changes are necessary for life. You know what now I have a crush on typescript😊 as it is an advancement of javascript.
So I thought I have to share this with you and I am here to share something about both languages.

JavaScript(Js)

Basically, it is a programming language and one of the core technology of web development.
It is mostly suitable for client-side dynamic pages for the website. Program or code you write in JS is called script that’s why it is also referred to as the scripting language.

Once you declared the type of variable you can change the type of that variable in future. Means If you declared a variable of type Number you can reassign it to a string.

Using JS we can add contents to the browser, Change CSS styles, React to user events, create cool effects like popups and in many more other ways.

Typescript(Ts)

Basically, It is a superset of JS. It is known as Object Orientinting language. It allows us to use strict types and supports modern features like arrays, let, const and modules.

Browser doesn’t understand the typescript as JS. So typescript is converted into JS. And to convert it we use a compiler like Babel.

It Makes checking process and code debugging easier. As once you declared a variable of type number you can’t change it into a type of string or boolean or something else.

It has extra features like generics, interfaces, tuples etc which force you to use typescript. And It also can run on any environments as JS can without any problem.
So if you are a developer I am suggesting you use typescript and I know you will also gonna fall in love with this language :).
What you think let me know🤔.
Learn, code and grow😛.

--

--