Pure Ts Tour -
// Arrays let fruits: string[] = ["apple", "banana"]; let numbers: Array<number> = [1, 2, 3]; // Tuples (fixed length, typed positions) let person: [string, number] = ["John", 25]; person.push("extra"); // ⚠️ allowed but avoid – TS limitation
// 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
let stringBox: Box<string> = content: "coins" ; let numberBox: Box<number> = content: 100 ;
// Typed parameters and return value function greet(name: string, greeting?: string): string return `$greeting ?? "Hello", $name`; // Arrays let fruits: string[] = ["apple", "banana"];
interface Todo title: string; description: string; completed: boolean;
// Union type type Result = "success" | "error" | "loading"; let state: Result = "loading"; // Intersection type type Person = name: string ; type Employee = id: number ; type Worker = Person & Employee; let numbers: Array<
// Pick / Omit type ShortTodo = Pick<Todo, "title" | "completed">; type NoDesc = Omit<Todo, "description">;
