템플릿 리터럴 타입 - 타입 조작하기

/**
 * 템플릿 리터럴 타입
 */

type Color = "red" | "green" | "blue";

type Animal = "dog" | "cat" | "chicken";

// Color의 타입과 Animal의 타입이 모두 조합된 것을 만들 수 있다.
type ColoredAnimal = `${Color}-${Animal}`; 

const coloredAnimal : ColoredAnimal = ''

Untitled