TypeScript 타입 조합/확장 문법 정리
1. & (Intersection, 교차 타입)여러 타입을 합쳐서 모든 속성을 가지는 새 타입을 만든다.중복되는 속성이 있다면, 마지막에 선언된 타입 기준으로 덮어쓴다.type A = { id: number; name: string }type B = { name: string; age: number }type AB = A & B// AB는 { id: number; name: string; age: number }가 된다.2. | (Union, 유니언 타입)여러 타입 중 하나를 가질 수 있다.if/else나 switch 문, 타입 가드로 분기 처리 가능type Status = "loading" | "success" | "error"function printStatus(s: Status) { // s는 세..