PLAY 80s and 90s PC CLASSICS ON WINDOWS 11, 10, 8, 7, VISTA, XP & MACINTOSH OSX
Cart 0

Pure Ts Tour Upd Access

// Generic function function identity<T>(value: T): T return value;

// Literal types let direction: "north" | "south" | "east" | "west"; direction = "north"; // OK // direction = "up"; // Error pure ts tour

// Interface interface User readonly id: number; // cannot change after init name: string; email?: string; // optional // Generic function function identity&lt

function processValue(value: string | number): string if (typeof value === "string") return value.toUpperCase(); return value.toFixed(2); (value: T): T return value