What is Typescript?

Aykut Korkmaz
3 min readNov 11, 2019

TypeScript is defined as JavaScript for application-scale development. TypeScript is a strongly-typed, object-oriented and compilable open source programming language. Designed by Anders Hejlsberg, a Microsoft employee and C # designer, the first version was released in 2012. This article was written in February 2019 3.3 is the most current version. We can define TypeScript as both a language and a set of tools. It can be used to write JavaScript programs that can run in a client or server environment. It can be defined as a superset of JavaScript that includes all of its features and additional features. Increases productivity in large and complex coded projects.

Features:

  • JavaScript is TypeScript: When compiling the code written in TS, it is converted to its JS equivalent, outputs JS code, and executes the JS code. All features that apply to JS are valid in TS. Knowing JS in order to write TS code will help you to master a very high percentage of the work.
  • Can use all JS libraries: All JS libraries can be used on TS. JS output of all codes written as TS can use all JS frameworks, tools and libraries.
  • Portability: TypeScript is a platform-free language and can run on different browsers, devices, operating systems. It can work in any environment where JavaScript works.

Why use Typescript?

  • Compilation: JS is a interpreted language, there is no compilation phase, so error detection cannot be made until the code runs, and if there is an error, all code needs to be reviewed and it can take a long time. The TypeScript converter provides error checking during the compilation phase and resolves this problem.
  • Strong Static Types: There is no static data typing in the JS language, the type of data is dynamically determined during execution. In TS, data definition is optional.
  • Easy to Read: It is an easy-to-read and editable language due to its advantages over JS code.

TypeScript and JavaScript Differences:

  • TS is an object-oriented program language, JS is a scripting language.
  • TS has static data typing, JS recognizes data dynamically.
  • The TS optionally supports parameterized functions, but not JS.
  • TS does not support abstract classes.
  • The development phase of large and complex projects designed as TS and JS can be reduced to much shorter periods. Error checking cannot be done because JS code is not compiled, but this phase takes time because compiling is done in TS code. This is not a disadvantage when the entire development phase is taken into consideration.

Typescript and ECMAScript

ECMAScript is the scripting language standard and new versions are released each year. As of 2019, there are 10 versions available. The TypeScript language is built on the EcmaScript standards, adding additional features to those standards that enable software developers to generate JavaScript code in a healthier way. Typescript has been revealed by adding extra features to versions 5 and 6 of EcmaScript.

Browsers do not fully support EcmaScript version 6. TS converts unsupported parts to version 5 and processes them.

--

--