srwx / practice-typescript

Self learning in TypeScript fundamental.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project is for learning TypeScript.

What TypeScript? 😵

  • Open-source programming language from Microsoft.
  • Typed superset of JavaScript.
  • Compiled down to plain JavaScript which is understood by browser.

Why TypeScript? 🤨

  • In general, variable in JavaScript is dynamic type that JavaScript doesn't know variable type until runtime.
  • TypeScript is static type that knew variable type before runtime. so TypeScript able to handle type error better than js.

Install TypeScript 🚧

  1. Install node.js
  2. Run command: npm install -g typescript
  3. Run command: tsc -v (Optionals, to check typescript version.)

Compile .ts file 🚀

  • Run command: tsc [filename].ts
  • TypeScript will build .js file, so you can run .js file by node using command: node [filename].js
  • (Options) You can automatically recompile .ts file to .js file using command: tsc [filename].ts --watch

Summary in index.ts file with 6 topics 📌

  1. Variable Declarations
  2. Variable Types
  3. Function
  4. Interface
  5. Class
  6. Class Access Modifiers

About

Self learning in TypeScript fundamental.


Languages

Language:JavaScript 53.5%Language:TypeScript 46.5%