TypeScript Tutorial for Beginners to Advanced — Introduction

Itznur07
3 min readJun 27, 2022

TypeScript is an open-source, object-oriented language developed and maintained by Microsoft, licensed under Apache 2 license.

photo from google search

TypeScript is an open-source object-oriented language developed and maintained by Microsoft, licensed under Apache 2 license. It is a typed superset of Javascript that compiles to plain JavaScript. The typeScript was developed under Anders Hejlsberg, who also led the creation of the C# language. The TypeScript was first released in October 2012.

☑ Why TypeScript?

JavaScript is a dynamic programming language with no type of system. JavaScript provides primitive types like strings, numbers, objects, etc., but it doesn’t check assigned values. JavaScript variables are declared using the var keyword, and it can point to any value. JavaScript doesn’t support classes and other object-oriented features (ECMA2015 supports it). So, without the type system, it is not easy to use JavaScript to build complex applications with large teams working on the same code.

The type system increases the code quality, and readability and makes it easy to maintain and refactor the codebase. More importantly, errors can be caught at compile time rather than at runtime.

☑ How to use TypeScript?

TypeScript code is written in a file with .ts extension and then compiled into JavaScript using the TypeScript compiler. A TypeScript file can be written in any code editor. A TypeScript compiler needs to be installed on your platform. Once installed, the command tsc <filename>.ts compiles the TypeScript code into a plain JavaScript file. JavaScript files can then be included in the HTML and run on any browser.

☑ TypeScript Features

  • Cross-Platform: TypeScript runs on any platform that JavaScript runs on. The TypeScript compiler can be installed on any Operating System such as Windows, macOS, and Linux.
  • Object-Oriented Language: TypeScript provides powerful features such as Classes, Interfaces, and Modules. You can write pure object-oriented code for client-side as well as server-side development.
  • Static type-checking: TypeScript uses static typing. This is done using type annotations. It helps type checking at compile time. Thus, you can find errors while typing the code without running your script each time. Additionally, using the type inference mechanism, if a variable is declared without a type, it will be inferred based on its value.
  • Optional Static Typing: TypeScript static typing is optional if you prefer to use JavaScript’s dynamic typing.
  • DOM Manipulation: Like JavaScript, TypeScript can be used to manipulate the DOM.
  • ES 6 Features: TypeScript includes most features of planned ECMAScript 2015 (ES 6, 7) such as class, interface, Arrow functions, etc.

Credit on https://www.tutorialsteacher.com/

MY SOCIAL LINK:

GITHUB: https://github.com/ItzNur07

LINKEDIN: https://www.linkedin.com/in/itznur07/

--

--

Itznur07

Hi, I’m Nur . I’m a Witter in medium.com . I’m Share a lot of tips with you. thanks for visiting my profile .