0 votes
in Dot Net by

How is TypeScript different from JavaScript?

1 Answer

0 votes
by

TypeScript is different from JavaScript in the following manner:

SNJavaScriptTypeScript
1It was developed by Netscape in 1995.It was developed by Anders Hejlsberg in 2012.
2JavaScript source file is in ".js" extension.TypeScript source file is in ".ts" extension.
3JavaScript doesn't support ES6.TypeScript supports ES6.
4It doesn't support strongly typed or static typing.It supports strongly typed or static typing feature.
5It is just a scripting language.It supports object-oriented programming concept like classes, interfaces, inheritance, generics, etc.
6JavaScript has no optional parameter feature.TypeScript has optional parameter feature.
7It is interpreted language that's why it highlighted the errors at runtime.It compiles the code and highlighted errors during the development time.
8JavaScript doesn't support modules.TypeScript gives support for modules.
9In this, number, string are the objects.In this, number, string are the interface.
10JavaScript doesn't support generics.TypeScript supports generics.


Related questions

0 votes
asked Jun 3, 2020 in Dot Net by GeorgeBell
0 votes
asked Mar 22, 2022 in TypeScript - JavaScript's Superset by sharadyadav1986
...