Logo Light
decent-docs

TypeScript

Steps to Switch from JS to TS

Switching to TypeScript

If you're choosing TypeScript:
Spend 2 painful days at the start — after that, you'll love TypeScript.
It’ll save you hours later, trust the process.

Tutorial time: 0h 8m 14s


Most Used Types in TS

Types
const a: string = 'hello';
 
const b: number = 1;
 
const c: boolean = true;
 
const d: null = null;
 
const e: undefined = undefined;
 
const f: void = undefined;
 
const g: unknown = null;
 
const h: any = 'hello';
 
const i: object = { name: 'John' };
 
array (e.g., string[] or Array<string>)
 
tuple (e.g., [string, number])
 
union (e.g., string | number)
 
type / interface (custom types)

Best Trick to Get Unknown Types in TypeScript

Tutorial time: 0h 0m 56s

On this page