<aside> 📌 유니언 타입 (타입의 OR 표현) 은 파이프 연산자 (|) 를 사용해서 나타내자

</aside>

let strOrNum: string | number = 'hello';
strOrNum = 1;

타입 좁히기: 특정 타입만 사용할 수 있는 메서드가 있을 때

let strOrNum: string | number = 'hello';
strOrNum = 1;

if (typeof strOrNum === number) {
	strOrNumb.toFixed();
}

파이프 연산자는 타입 앞에도 사용 가능하다.

type Union = 
	**|** string
	| boolean
	| null;