# as const satisfies Record<string, { age: number, ... }>

보통 타입의 상수 선언을 하기 위해서는 `as const` 를 많이 사용하게 되는데, 이때 아래와 같은 경우가 생긴다.

```
const obj = {
  hyeonwoo: { age: 29, hobby: 'basketball' },
  minsoo: { age: 29, hobby: 'reading' },
  gildong: { age: 29, from: 'southKorea' },
} as const
```

이때 단순 상수 선언만 해주었기 때문에 내부 객체의 속성 값이 다른 요소와 달라도 오류가 발생하지 않는다, 다른 요소들과 통일성을 맞춰주기 위해 하나의 추가 타입 선언을 해주어야하는데 바로 `satisfies` 이다.

```
interface ObjConfig {
  age: number,
  hobby: string
}

const obj = {
  hyeonwoo: { age: 29, hobby: 'basketball' },
  minsoo: { age: 29, hobby: 'reading' },
  gildong: { age: 29, from: 'southKorea' }, // from에서 IDE 오류 발생
} as const satisfies Record<string, ObjConfig>
```

For the site tree, see the [root Markdown](https://slashpage.com/timmy.md).
