DEV Community

Cover image for Differences between Javascript and Typescript
Diego Cachafeiro for Product Hackers

Posted on

Differences between Javascript and Typescript

In this article we are going to talk about the differences between Javascript and Typescript, they are two languages that are widely use nowadays in all types of projects, JS was the first to be introduced as client-side language. As time passed the projects were JS was being used started to be too complex and heavy, thats were TS enters the game, and starts as language to resolve all the problems that JS was having at the moment, nowadays TS is a language widely used also and is becoming bigger and bigger, so I hope that with this article I can help you a little bit to now any differences or to resolve any doubts.

Image description

There are many differences, now I'm going to show you a comprehensible list of differences.

Differences

  1. JS is used for client-side mostly while TS is used mostly for both client-side and server-side.
  2. TS has an improved readability, since JS requires a lot of manual detection of bugs and errors, this has been improved a lot by TS.
  3. TS has static typing while JS doesn't support it since JS is a dynamically-typed language.
  4. TS supports ES6.
  5. TS has a full support in modern IDE.
  6. TS can also convert its code to JS if necessary.
  7. Using TS means that you can use OOP(Object-oriented programming) principles.
  8. In JS functions are considered an object and they can have its own method and properties.

Conclusion

The choice is up to you at the end on what to choose if you want to work with this languages, you will have to balance the pros and the cons between both of them, and make an educated choice. Usually the option you choose will come from different variables like having in mind the size and complexity of the project you are going to work on, there are more differences between this two languages but the ones I wrote are the main ones and the important ones, I hope you like the article, any queries feel free to comment and ask!

Top comments (1)

Collapse
 
bwca profile image
Volodymyr Yepishev

Typescript is highly addictive 🤓