๐๐ป๐๐ฟ๐ผ๐ฑ๐๐ฐ๐๐ถ๐ผ๐ป ๐๐ผ ๐ง๐๐ฝ๐ฒ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐
TypeScript is a version of JavaScript. It adds a type system to your code.
JavaScript finds errors when you run the app. TypeScript finds errors while you write the code. If you use a string instead of a number, your editor shows the error.
This helps you avoid bugs. It makes changing code safer.
Why use TypeScript?
- Code stays documented.
- Your editor suggests the right code.
- Large projects stay easy to manage.
- You add it to existing projects one file at a time.
Types disappear after you compile the code. They only exist to help you build the app.
Key tools:
- Basic types: Define variables as strings, numbers, or booleans.
- Interfaces: Create a contract for object structures.
- Generics: Write code for any type without losing safety.
- Enums: Define a set of fixed values.
- Union types: Let a variable be one of several types.
Source: https://dev.to/yuripeixinho/introducao-ao-typescript-1j4n