Skip to content

Commit e1eedfa

Browse files
committed
translate docs for ko
1 parent ea3e103 commit e1eedfa

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/documentation/ko/handbook-v2/Type Manipulation/Typeof Type Operator.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
---
22
title: Typeof Type Operator
33
layout: docs
4-
permalink: /docs/handbook/2/typeof-types.html
5-
oneline: "Using the typeof operator in type contexts."
4+
permalink: /ko/docs/handbook/2/typeof-types.html
5+
oneline: "타입 컨텍스트에서 typeof 연산자 사용하기."
66
---
77

8-
## The `typeof` type operator
8+
## `typeof` 타입 연산자
99

10-
JavaScript already has a `typeof` operator you can use in an _expression_ context:
10+
JavaScript에서는 이미 _표현식_ 컨텍스트에서 사용할 수 있는 `typeof` 연산자가 있습니다.
1111

1212
```ts twoslash
13-
// Prints "string"
13+
// "string"을 출력합니다
1414
console.log(typeof "Hello world");
1515
```
1616

17-
TypeScript adds a `typeof` operator you can use in a _type_ context to refer to the _type_ of a variable or property:
17+
TypeScript는 _타입_ 컨텍스트에서 변수나 프로퍼티의 타입을 추론할 수 있는 `typeof` 연산자를 추가합니다.
1818

1919
```ts twoslash
2020
let s = "hello";
2121
let n: typeof s;
2222
// ^?
2323
```
2424

25-
This isn't very useful for basic types, but combined with other type operators, you can use `typeof` to conveniently express many patterns.
26-
For an example, let's start by looking at the predefined type `ReturnType<T>`.
27-
It takes a _function type_ and produces its return type:
25+
기본 타입에 대해선 별로 유용하진 않지만, 다른 타입 연산자와 함께 `typeof`를 사용하여 많은 패턴을 편리하게 표현할 수 있습니다.
26+
예를 들어, 미리 정의된 타입인 `ReturnType<T>` 부터 살펴보겠습니다.
27+
위 타입은 _함수 타입_ 을 받으면서 반환되는 타입을 제공합니다.
2828

2929
```ts twoslash
3030
type Predicate = (x: unknown) => boolean;
3131
type K = ReturnType<Predicate>;
3232
// ^?
3333
```
3434

35-
If we try to use `ReturnType` on a function name, we see an instructive error:
35+
함수 이름에 `ReturnType`을 사용하면, 안내 오류를 확인할 수 있습니다.
3636

3737
```ts twoslash
3838
// @errors: 2749
@@ -42,8 +42,8 @@ function f() {
4242
type P = ReturnType<f>;
4343
```
4444

45-
Remember that _values_ and _types_ aren't the same thing.
46-
To refer to the _type_ that the _value `f`_ has, we use `typeof`:
45+
___타입_ 은 같지 않다는 것을 명심하세요.
46+
_`f`_ _타입_ 을 추론하기 위해서 `typeof`를 사용합니다.
4747

4848
```ts twoslash
4949
function f() {
@@ -53,12 +53,12 @@ type P = ReturnType<typeof f>;
5353
// ^?
5454
```
5555

56-
### Limitations
56+
### 제한
5757

58-
TypeScript intentionally limits the sorts of expressions you can use `typeof` on.
58+
TypeScript는 `typeof`를 사용할 수 있는 표현식의 종류를 의도적으로 제한합니다.
5959

60-
Specifically, it's only legal to use `typeof` on identifiers (i.e. variable names) or their properties.
61-
This helps avoid the confusing trap of writing code you think is executing, but isn't:
60+
특히, 식별자(예: 변수이름) 혹은 프로퍼티에서만 `typeof`를 사용할 수 있습니다.
61+
실행 중인 것으로 생각되는 코드 작성의 실수를 피하는데 도움을 줄 수 있지만, 그렇진 않습니다.
6262

6363
```ts twoslash
6464
// @errors: 1005

0 commit comments

Comments
 (0)