Skip to content

Commit

Permalink
docs(Record): Update Record Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
haejunejung committed Aug 12, 2024
1 parent 3b37a0e commit 199822f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 4 additions & 5 deletions docs/ko/reference/built-in/Record.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

## 문법

`Record<Keys, Type>`은 `Keys`와 `Type` 두 개의 λ§€κ°œλ³€μˆ˜λ₯Ό μ‚¬μš©ν•΄μš”.
- **Keys**: 객체의 ν‚€λ‘œ μ‚¬μš©ν•  νƒ€μž…μ΄μ—μš”.
- **Type**: 객체의 κ°’μœΌλ‘œ μ‚¬μš©ν•  νƒ€μž…μ΄μ—μš”.

```ts
Record<Keys, Type>;
type Record<K extends keyof any, T> = { [P in K]: T };
```

- **Keys (K)**: 객체의 ν‚€λ‘œ μ‚¬μš©ν•  νƒ€μž…μ΄μ—μš”.
- **Type (T)**: 객체의 κ°’μœΌλ‘œ μ‚¬μš©ν•  νƒ€μž…μ΄μ—μš”.

## 예제

#### 예제 #1
Expand Down
9 changes: 6 additions & 3 deletions docs/reference/built-in/Record.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ The `Record<Keys, Type>` utility type is available starting from TypeScript 2.1.

## Syntax

`Record<Keys, Type>` takes two parameters `Keys` and `Type`.
- **Keys**: This is the type of object's keys that the record type generates for us.
- **Type**: This is the type of the object's value generated by the record type.
```ts
type Record<K extends keyof any, T> = { [P in K]: T };
```

- **Keys (K)**: This is the type of object's keys that the record type generates for us.
- **Type (T)**: This is the type of the object's value generated by the record type.

```
Record<Keys, Type>;
Expand Down

0 comments on commit 199822f

Please sign in to comment.