Skip to content

Repository files navigation

🚀 TypeScript Fundamentals

A hands-on practice repository I built to solidify the TypeScript fundamentals covered in an Angular course. Each file focuses on one topic with small, runnable examples that show what TypeScript adds on top of JavaScript: catching type errors at compile time instead of at runtime.

📚 Topics

File Topic
FirstLesson.ts First steps: compiling a .ts file with tsc
VariableTypes.ts Basic and advanced types: string, number, boolean, arrays, tuples, enums, any
functions.ts Typed parameters and return values, optional and default parameters
classes.ts Classes, constructors and methods
inhertance.ts Inheritance with extends, and public / protected / private access modifiers
Interface.ts Interfaces and optional properties
Generics.ts Generic functions and classes for reusable, type-safe code
Car.ts · Module.ts Modules: exporting a class from one file and importing it in another

🛠️ How to run

  1. Clone the repository:
    git clone https://github.com/CestnyTR/typescript-basic.git
    cd typescript-basic
  2. Compile a file and run the output with Node.js:
    npx tsc VariableTypes.ts
    node VariableTypes.js
    Or run it directly without a separate compile step:
    npx tsx VariableTypes.ts

Some examples intentionally contain type errors (e.g. passing a string where a number is expected) to show how the compiler catches them.

🧰 Tech

TypeScript · Node.js

Releases

Packages

Contributors

Languages