JavaScript is the most popular programming language of HTML and the Web. JavaScript is an object-based scripting language which is lightweight and cross-platform. TypeScript is an open-source pure object-oriented programing language. It is a strongly typed superset of JavaScript which compiles to plain JavaScript.
JavaScript | TypeScript |
---|---|
It doesn’t support strongly typed or static typing. | It supports strongly typed or static typing feature. |
Netscape developed it in 1995. | Anders Hejlsberg developed it in 2012. |
JavaScript source file is in .js extension. | TypeScript source file is in .ts extension. |
It is directly run on the browser. | It is not directly run on the browser. |
It is just a scripting language. | It supports object-oriented programming concept like classes, interfaces, inheritance, generics, etc. |
It doesn’t support optional parameters. | It supports optional parameters. |
It is interpreted language that’s why it highlighted the errors at runtime. | It compiles the code and highlighted errors during the development time. |
JavaScript doesn’t support modules. | TypeScript gives support for modules. |
In this, number, string are the objects. | In this, number, string are the interface. |
JavaScript doesn’t support generics. | TypeScript supports generics. |