<aside> 📌 값 자체가 타입인 리터럴 타입

</aside>

let str: 'hello' = 'hello';
str = 'world'; // Type '"world"' is not assignable to type '"hello"'

객체와 변수, 함수의 타입

const obj: { name: 'zero' } = { name: 'zero' };
const arr: [1, 3, 'five'] = [1, 3, 'five'];
const func: (amount: number, unit: string) => string
	= (amount, unit) => amout + unit;

값이 변하지 않는 객체, 배열

<aside> 📌 as const 라는 특별한 접미사를 붙이면 값을 바꿀 수 없다. (read-only)

</aside>

const obj = { name: 'Lee' } as const;

obj.name = 'Kim'; // Cannot assign to 'name' because it is a read-only property.