Typing is the key TypeScript feature.
So far we compiled a
The most important piece of functionality provided by TypeScript is the type system.
If you ever used a typed language, like Go or C, you already know how this works. If not, and you only programmed in a dynamic language like Python or Ruby, this is all new to you but don’t worry.
The type system allows you, for example, to add types to your variables, function arguments and function return types, giving a more rigid structure to your programs.
The advantages are better tooling: the compiler (and editors like editors like VS Code) can help you a lot during development, pointing out bugs as you write the code. Bugs that couldn’t possibly be detected if you didn’t have types. Also, teamwork gets easier because the code is more explicit.
Here is how you define a string variable in TypeScript:
const greeting : string = "hello!"
Type inference lets us avoid writing the type in obvious cases like this:
const greeting = "hello!"
The type is determined by TS.
Lessons this unit:
|1:||Your first TypeScript program|
|4:||The editor helps you with type errors|
|5:||Running TypeScript code|
|7:||Type aliases and interfaces|
|9:||Typing arrays with generics|
|10:||The DX of editing TypeScript|
|12:||tsconfig.json COMING SOON|
|13:||Installing types COMING SOON|