Skip to content

Commit a57efba

Browse files
committed
[문서] C02 - 2.7 형 변환 충돌 해결 및 번역 진행
1 parent 355e1ff commit a57efba

1 file changed

Lines changed: 4 additions & 22 deletions

File tree

1-js/02-first-steps/07-type-conversions/article.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77
이 외에, 전달받은 값을 의도를 갖고 원하는 타입으로 변환(명시적 변환)해 주는 경우도 형 변환이라고 할 수 있습니다.
88

9-
<<<<<<< HEAD
10-
```smart header="객체의 형변환은 나중에 다룹니다."
11-
이 챕터에선 객체는 다루지 않겠습니다. 여기선 원시형의 형변환에 대해서만 다룰 예정입니다.
12-
=======
13-
```smart header="Not talking about objects yet"
14-
In this chapter, we won't cover objects. For now, we'll just be talking about primitives.
15-
>>>>>>> upstream/master
9+
```smart header="객체의 형 변환은 나중에 다룹니다."
10+
이 챕터에선 객체는 다루지 않겠습니다. 여기선 원시형의 형 변환에 대해서만 다룰 예정입니다.
1611
1712
객체의 형 변환이 어떻게 이뤄지는지 <info:object-toprimitive>에 대해선 객체에 대한 학습이 끝난 후 알아보겠습니다.
1813
```
@@ -39,11 +34,7 @@ alert(typeof value); // string
3934

4035
## 숫자형으로 변환
4136

42-
<<<<<<< HEAD
4337
숫자형으로의 변환은 수학과 관련된 함수와 표현식에서 자동으로 일어납니다.
44-
=======
45-
Numeric conversion in mathematical functions and expressions happens automatically.
46-
>>>>>>> upstream/master
4738

4839
숫자형이 아닌 값에 나누기 `/`를 적용한 경우와 같이 말이죠.
4940

@@ -78,13 +69,8 @@ alert(age); // NaN, 형 변환이 실패합니다.
7869
|-------|-------------|
7970
|`undefined`|`NaN`|
8071
|`null`|`0`|
81-
<<<<<<< HEAD
8272
|<code>true&nbsp;and&nbsp;false</code> | `1``0` |
83-
| `string` | 문자열의 처음과 끝 공백이 제거됩니다. 공백 제거 후 남아있는 문자열이 없다면 `0`, 그렇지 않다면 문자열에서 숫자를 읽습니다. 변환에 실패하면 `NaN`이 됩니다.|
84-
=======
85-
|<code>true&nbsp;and&nbsp;false</code> | `1` and `0` |
86-
| `string` | Whitespaces (includes spaces, tabs `\t`, newlines `\n` etc.) from the start and end are removed. If the remaining string is empty, the result is `0`. Otherwise, the number is "read" from the string. An error gives `NaN`. |
87-
>>>>>>> upstream/master
73+
| `string` | 문자열의 처음과 끝 공백(스페이스, 탭 `\t`, 줄 바꿈 `\n` 등)이 제거됩니다. 공백 제거 후 남아있는 문자열이 없다면 `0`, 그렇지 않다면 문자열에서 숫자를 읽습니다. 변환에 실패하면 `NaN`이 됩니다.|
8874

8975
예시:
9076

@@ -144,11 +130,7 @@ alert( Boolean(" ") ); // 공백이 있는 문자열도 비어있지 않은 문
144130
|`undefined`|`NaN`|
145131
|`null`|`0`|
146132
|<code>true&nbsp;/&nbsp;false</code> | `1 / 0` |
147-
<<<<<<< HEAD
148-
| `string` | 전달받은 문자열을 "그대로" 읽되, 처음과 끝의 공백을 무시합니다. 문자열이 비어있다면 `0`이 되고, 오류 발생 시 `NaN`이 됩니다. |
149-
=======
150-
| `string` | The string is read "as is", whitespaces (includes spaces, tabs `\t`, newlines `\n` etc.) from both sides are ignored. An empty string becomes `0`. An error gives `NaN`. |
151-
>>>>>>> upstream/master
133+
| `string` | 전달받은 문자열을 "그대로" 읽되, 처음과 끝의 공백(스페이스, 탭 `\t`, 줄 바꿈 `\n` 등)을 무시합니다. 문자열이 비어있다면 `0`이 되고, 오류 발생 시 `NaN`이 됩니다. |
152134
153135
**`불린형으로 변환`** 은 논리 연산 시 발생합니다. `Boolean(value)`으로도 변환할 수 있습니다.
154136

0 commit comments

Comments
 (0)