📘

TypeScript Reference

A strongly typed superset of JavaScript that scales to large applications. Essential syntax and code samples for professional development.

Interfaces

interface User { id: number; name: string; }

Generics

function wrap<T>(item: T): T[] { return [item]; }

Enums

enum Status { Active, Inactive }

Types

type Point = { x: number; y: number };

Optional

function greet(msg?: string) { console.log(msg || "Hi"); }

Assertions

const str = someVal as string;