TypeScript – First steps with TypeScript – part 002 .

Note: The speed of development of the JavaScript programming language is quite fast, and
theoretically learning the TrueScript language is more difficult, but this is not my goal.
I recommend learning truescript only to those who know JavaScript quite well.

Let’s recap a bit and fix the defining elements between JavaScript and TypeScript.
The typescript code needs to be compiled while JavaScript code doesn’t need to compile.
The process of verifying and enforcing the constraints of types is named Type checking.
Static type checking is the process of verifying the type safety of a program based on analysis of a program’s text (source code).
Dynamic type checking is the process of verifying the type safety of a program at runtime.
TypeScript provides static typing through type annotations to enable type checking at compile time.
In JavaScript, this can be optional and can be ignored.
a JavaScript program is also a valid TypeScript program
The typescript code needs to be compiled while JavaScript code doesn’t need to compile.
Typescript is a superset of JavaScript.
With TypeScript, it is possible to use existing JavaScript code, incorporate popular JavaScript libraries,
Typescript uses concepts like types and interfaces to describe data
Typescript supports a feature of prototyping.
The prototype is a creational design pattern that allows cloning objects, even complex ones, without coupling to their specific classes.
Let’s see how this working.
When you declare a class in TypeScript, you are actually creating multiple declarations at the same time.
Also, is no special significance of a prototype property in TypeScript beyond the normal special significance of the prototype property of JavaScript constructors.
Now about the prototype property allows you to add properties and methods to an object.
For example, let’s start with the type of the instance of the class.

In practice, the JavaScript created by the above example:

The new return value of a constructor and the prototype of the constructor are nominally the same types.
Note the JavaScript allows constructors to return values that are not of their own type.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.