mikaelvesavuori / 5-minutes-or-less-typescript-js

Patterns and features of TypeScript and JavaScript, demystified in less than 5 minutes each.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

5 Minutes or Less: TypeScript/JavaScript patterns and features

Patterns and features of TypeScript and JavaScript, demystified in less than 5 minutes each

This is a collection of briefly presented concepts, features, and patterns that I find interesting in TS/JS.

Five Minutes or Less

Content

Current contents:

  • TypeScript 5.0 decorators
  • Index signatures
  • Maps and sets
  • Metaprogramming (Reflect API and Proxy)
  • Nullish coalescing
  • Static factory function
  • Utility types:
    • Exclude
    • Omit
    • Parameters
    • Partial
    • Pick
    • Required
    • Return type

Running the code

You can install the things with npm install and then just go at each file with npx ts-node src/{filename}.ts.

Or, if you're lazy, you can also copy the individual TS file's contents into the TypeScript playground if you want to avoid cloning and installing anything at all.

About

Patterns and features of TypeScript and JavaScript, demystified in less than 5 minutes each.


Languages

Language:TypeScript 100.0%