...

/

Introduction to TypesScript

Introduction to TypesScript

Get introduced to Typescript in this lesson.

Introducing TypeScript

In programming, the type variable data indicates the set of values that are valid for that data. For example, if a variable is an integer, we would expect the variable to have a value such as 1, -3, or 357 and not a value like banana. If the variable is set to a value that is not of the expected type, we think that something bad will happen. In some languages, attempting to set data to the wrong value leads to a compiler error, in other languages it leads to incorrect or unspecified behavior at runtime.

All high-level programming languages use some concept of type to determine behavior, which is to say that all these languages determine behavior by using not just the value of a variable in the system but also information about what kind of value it is.

TypeScript is a superset of JavaScript that allows us to optionally add annotations to the code to specify type information. ...