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<
function processValue(value: string | number): string if (typeof value === "string") return value.toUpperCase(); return value.toFixed(2); (value: T): T return value