What is TypeScript?

7wx6...SnM4
21 Mar 2024
4

JavaScript, which is widely used in web applications, has begun to be used frequently in server-side applications with Node.js, in desktop applications with Electron.js, and in hybrid mobile application development thanks to various libraries, and has shown an unexpected growth. Since such platforms and large-scale applications were not considered as the design purpose, JavaScript had some structural deficiencies. There were no structures such as type checking and classes provided by object-oriented languages, there was no compilation phase because it was dynamic, and error checking was difficult. TypeScript emerged as a programming language designed to eliminate these deficiencies and use JavaScript more effectively in large projects.
What is TypeScript?
“TypeScript, JavaScript for application-scale development.” It is defined as . TypeScript is a strongly-typed, object-oriented and compilable open-source programming language. It was designed by Anders Hejlsberg, a Microsoft employee and designer of the C# language, and its first version was published in 2012. 3.3 is the most current version as of February 2019, when this article was written. 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 its features and has additional features added. It increases efficiency in large and complex coding projects.
Features
JavaScript is TypeScript: While the codes written in TS are compiled, they are converted into their equivalents in the JS language, giving JS code as output, and the JS code is executed. All features valid for JS are valid for TS. Knowing JS to write TS code will enable you to master a large portion of the work. TypeScript is an extended version of JavaScript. Every JS code is a TS code. However, TS code is not JS code unless it is compiled and run. Can use all JS libraries: All JS libraries can also be used on TS. The 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 run in any environment where JavaScript runs. Unlike its counterparts (CoffeScript, Dart, etc.), TypeScript does not need a special virtual machine or a special working-execution environment to execute, since the written codes are converted to JS code and the operations are carried out through the JS code.
Components
TypeScript has three basic components. Language: Has its own syntax, keywords and type definitions. Compiler: Converts the code written in TS to its equivalent in JS. TLS (TypeScript Language Service): Expression completion, code formatting, coloring, etc. for use in editors. Supports typical editor operations such as
TypeScript and JavaScript Differences TS is an object-oriented programming language, JS is a scripting language. TS has static data typing, JS recognizes data dynamically. TS optionally supports parameterized functions, but JS does not. The development phase of large and complex projects designed in TS and JS can be reduced to much shorter times. Since JS code is not compiled, error checking cannot be done, but since TS code is compiled, this stage takes time. Considering the entire development phase, it is not a disadvantage that would pose a problem. TS does not support abstract classes.

Write & Read to Earn with BULB

Learn More

Enjoy this blog? Subscribe to volkan1627

1 Comment

B
No comments yet.
Most relevant comments are displayed, so some may have been filtered out.