
Typescript의 연산자typescript에서 연산자를 이용한 타입 정의는 크게 union type과 intersection type으로 나눌 수 있습니다.오늘은 union type과 intersection type을 사용했을 때 각각 어떻게 type이 정의 되는지 알아보도록 하겠습니다. Union Type이란?union type은 | 를 사용하며 type이 A이거나 B라는 의미를 가집니다.function execute(text: string): void { console.log(text);}function execute(text: number): void { console.log(text);}union type을 사용하면 함수들을 합쳐 여러 개의 타입을 연결 할 수 있습니다.functio..