https://github.com/juniorreisx/introduction-to-typescript
Basic TypeScript
https://github.com/juniorreisx/introduction-to-typescript
class function object typescript variables
Last synced: about 2 months ago
JSON representation
Basic TypeScript
- Host: GitHub
- URL: https://github.com/juniorreisx/introduction-to-typescript
- Owner: JuniorReisx
- Created: 2025-03-03T00:37:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T00:43:14.000Z (over 1 year ago)
- Last Synced: 2025-03-03T01:31:01.835Z (over 1 year ago)
- Topics: class, function, object, typescript, variables
- Language: TypeScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```markdown
# TypeScript Basics Project
This project demonstrates the fundamentals of TypeScript, showcasing various concepts such as primitive types, functions, arrays, classes, and more.
## Features
- **Primitive Types**: `string`, `number`, `boolean`, `null`, `undefined`, `any`, `void`, `never`
- **Objects and Interfaces**: Creating and using interfaces with objects.
- **Arrays and Tuples**: Type-safe arrays and tuples.
- **Functions**: Functions with different argument types, async functions, and function overloading.
- **Classes**: Implementing basic classes with methods and access modifiers.
- **Working with Dates**: Using the `Date` object in TypeScript.
- **Array Methods**: Demonstrating common array methods like `map`, `filter`, `reduce`, `find`, `some`, and `every`.
## Installation
To get started with this project, clone it to your local machine:
```bash
git clone https://github.com/your-username/your-repository.git
```
Navigate to the project folder and install dependencies:
```bash
cd your-repository
npm install
```
## Running the Project
To run the project, use the following command:
```bash
npm run start
```
This will execute the code and print the results in the console.
## Code Structure
- **Primitive Types**: Demonstrates the basic types in TypeScript.
- **Interfaces**: Defines `Pessoa`, `Carro`, and `Viagem` interfaces and shows how to create objects using these interfaces.
- **Functions**: Examples of various functions such as a simple sum function, async function, and functions with union types.
- **Classes**: The `Character` class and `Person` class with access modifiers and inheritance.
## Example Output
```bash
Jonh attacks with 100 power!
Ligando para 999999999
Endereço do CEP 12345-678: Rua X, Bairro Y
João possui um carro da marca Fiat
1 2 3 4 5 JONH true
```
## Contributing
Feel free to fork the repository, create issues, and submit pull requests if you find any bugs or have ideas for improvements.
## License
This project is open source and available under the [MIT License](LICENSE).
```
You can replace `your-username` and `your-repository` with your actual GitHub username and repository name.
Let me know if you need any changes or additions!