Skip to content

Commit 091e3e0

Browse files
authored
TS for the new programmar 나머지 부분 번역 완료 (#143)
* TS New Programmer 부분 번역 * 나머지 부분 번역 완료 * 리뷰내용에 맞추어서 수정 반영 in #111 * 리뷰 내용에 따라 번역을 수정함 in #111
1 parent 58ce138 commit 091e3e0

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

pages/tutorials/ts-for-the-new-programmer.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -50,93 +50,93 @@ JavaScript가 처음 나왔을 때, 수십 줄 이상의 코드를 작성하는
5050
대부분의 프로그래밍 언어는 이런 종류의 오류들이 발생하면 오류를 표출해주고, 일부는 코드가 실행되기 전인 컴파일 중에 오류를 표출해줍니다.
5151
작은 프로그램을 작성할 때에는, 이런 이상한 점들이 화를 돋구지만 관리는 가능합니다. 그러나 수백 또는 수천 줄의 어플리케이션들을 작성할 때에는, 이러한 지속적 놀라움들은 심각한 문제입니다.
5252

53-
## TypeScript: A Static Type Checker
53+
## TypeScript: 정적 타입 검사자 (TypeScript: A Static Type Checker)
5454

55-
We said earlier that some languages wouldn't allow those buggy programs to run at all.
56-
Detecting errors in code without running it is referred to as _static checking_.
57-
Determining what's an error and what's not based on the kinds of values being operated on is known as static _type_ checking.
55+
앞서 몇 언어는 버그가 많은 프로그램을 아예 실행시키지 않는다고 했습니다.
56+
프로그램을 실행시키지 않으면서 코드의 오류를 검출하는 것을 _정적 검사_라고 합니다.
57+
어떤 것이 오류인지와 어떤 것이 연산 되는 값에 기인하지 않음을 정하는 것이 정적 _타입_ 검사입니다.
5858

59-
TypeScript checks a program for errors before execution, and does so based on the _kinds of values_, it's a _static type checker_.
60-
For example, the last example above has an error because of the _type_ of `obj`.
61-
Here's the error TypeScript found:
59+
_정적 타입 검사자_인 TypeScript는 프로그램을 실행시키기 전에 _값의 종류_를 기반으로 프로그램의 오류를 찾습니다.
60+
예를 들어, 위의 마지막 예시에 오류가 있는 이유는 `obj`_타입_ 때문입니다.
61+
다음은 TypeScript에서 볼 수 있는 오류입니다:
6262

63-
```ts twoslash
63+
```
6464
// @errors: 2551
6565
const obj = { width: 10, height: 15 };
6666
const area = obj.width * obj.heigth;
6767
```
6868

69-
### A Typed Superset of JavaScript
69+
### 타입이 있는 JavaScript의 상위 집합 (A Typed Superset of JavaScript)
7070

71-
How does TypeScript relate to JavaScript, though?
71+
그렇다면 TypeScript는 JavaScript와 어떤 관계일까요?
7272

73-
#### Syntax
73+
#### 구문 (Syntax)
7474

75-
TypeScript is a language that is a _superset_ of JavaScript: JS syntax is therefore legal TS.
76-
Syntax refers to the way we write text to form a program.
77-
For example, this code has a _syntax_ error because it's missing a `)`:
75+
TypeScript는 JS의 구문이 허용되는, JavaScript의 _상위 집합_ 언어입니다.
76+
구문은 프로그램을 만들기 위해 코드를 작성하는 방법을 의미합니다.
77+
예를 들어, 다음 코드는 `)`이 없으므로 _구문_ 오류입니다:
7878

79-
```ts twoslash
79+
```
8080
// @errors: 1005
8181
let a = (4
8282
```
8383

84-
TypeScript doesn't consider any JavaScript code to be an error because of its syntax.
85-
This means you can take any working JavaScript code and put it in a TypeScript file without worrying about exactly how it is written.
84+
TypeScript는 독특한 구문 때문에 JavaScript 코드를 오류로 보지 않습니다.
85+
즉, 어떻게 작성돼있는지 모르지만 작동하는 JavaScript 코드를 TypeScript 파일에 넣어도 잘 작동합니다.
8686

87-
#### Types
87+
#### 타입 (Types)
8888

89-
However, TypeScript is a _typed_ superset, meaning that it adds rules about how different kinds of values can be used.
90-
The earlier error about `obj.heigth` was not a _syntax_ error: it is an error of using some kind of value (a _type_) in an incorrect way.
89+
그러나 TypeScript는 다른 종류의 값들을 사용할 수 있는 방법이 추가된, _타입이 있는_ 상위 집합입니다.
90+
위의 `obj.heigth` 오류는 _구문_ 오류가 아닌, 값의 종류(_타입_)를 잘못 사용해서 생긴 오류입니다.
9191

92-
As another example, this is JavaScript code that you can run in your browser, and it _will_ print a value:
92+
또 다른 예시로, 아래와 같은 JavaScript 코드가 브라우저에서 실행될 때, 다음과 같은 값이 출력될 _것입니다_:
9393

9494
```js
9595
console.log(4 / []);
9696
```
9797

98-
This syntactically-legal program prints `NaN`.
99-
TypeScript, though, considers division of number by an array to be a nonsensical operation, and will issue an error:
98+
구문적으로 옳은(syntactically-legal) 위 코드는 JavaScript에서 `NaN`을 출력합니다.
99+
그러나 TypeScript는 배열로 숫자를 나누는 연산이 옳지 않다고 판단하고 오류를 발생시킵니다:
100100

101-
```ts twoslash
101+
```
102102
// @errors: 2363
103103
console.log(4 / []);
104104
```
105105

106-
It's possible you really _did_ intend to divide a number by an array, perhaps just to see what happens, but most of the time, though, this is a programming mistake.
107-
TypeScript's type checker is designed to allow correct programs through while still catching as many common errors as possible.
108-
(Later, we'll learn about settings you can use to configure how strictly TypeScript checks your code.)
106+
실제로 어떤 일이 일어나는지 보려는 의도로 숫자를 배열로 나눌 수 _있지만_, 대부분은 프로그래밍 실수입니다.
107+
TypeScript의 타입 검사자는 일반적인 오류를 최대한 많이 검출하면서 올바른 프로그램을 만들 수 있게 설계되었습니다.
108+
(나중에 TypeScript가 코드를 얼마나 엄격하게 검사할 수 있는지에 대한 설정에 대해 알아봅시다.)
109109

110-
If you move some code from a JavaScript file to a TypeScript file, you might see _type errors_ depending on how the code is written.
111-
These may be legitimate problems with the code, or TypeScript being overly conservative.
112-
Throughout this guide we'll demonstrate how to add various TypeScript syntax to eliminate such errors.
110+
만약 JavaScript 파일의 코드를 TypeScript 코드로 옮기면, 코드를 어떻게 작성했는지에 따라 _타입 오류_를 볼 수 있습니다.
111+
이는 코드 상의 문제이거나, TypeScript가 지나치게 보수적인 것일 수 있습니다.
112+
위와 같은 오류를 제거하기 위해 가이드는 다양한 TypeScript 구문을 추가하는 방법을 보여줍니다.
113113

114-
#### Runtime Behavior
114+
#### 런타임 특성 (Runtime Behavior)
115115

116-
TypeScript is also a programming language that preserves the _runtime behavior_ of JavaScript.
117-
For example, dividing by zero in JavaScript produces `Infinity` instead of throwing a runtime exception.
118-
As a principle, TypeScript **never** changes the runtime behavior of JavaScript code.
116+
TypeScript는 JavaScript의 _런타임 특성_을 가진 프로그래밍 언어입니다.
117+
예를 들어, JavaScript에서 0으로 나누는 행동은 런타임 예외로 처리하지 않고 `Infinity`값을 반환합니다.
118+
논리적으로, TypeScript는 JavaScript 코드의 런타임 특성을 **절대** 변화시키지 않습니다.
119119

120-
This means that if you move code from JavaScript to TypeScript, it is **guaranteed** to run the same way, even if TypeScript thinks that the code has type errors.
120+
즉 TypeScript가 코드에 타입 오류가 있음을 검출해도, JavaScript 코드를 TypeScript로 이동시키는 것은 같은 방식으로 실행시킬 것을 **보장합니다**
121121

122-
Keeping the same runtime behavior as JavaScript is a foundational promise of TypeScript because it means you can easily transition between the two languages without worrying about subtle differences that might make your program stop working.
122+
JavaScript와 동일한 런타임 동작을 유지하는 것은 프로그램 작동을 중단시킬 수 있는 미묘한 차이를 걱정하지 않고 두 언어 간에 쉽게 전환할 수 있도록 하기 위한 TypeScript의 기본적인 약속입니다.
123123

124124
<!--
125125
Missing subsection on the fact that TS extends JS to add syntax for type
126126
specification. (Since the immediately preceding text was raving about
127127
how JS code can be used in TS.)
128128
-->
129129

130-
#### Erased Types
130+
#### 삭제된 타입 (Erased Types)
131131

132-
Roughly speaking, once TypeScript's compiler is done with checking your code, it _erases_ the types to produce the resulting "compiled" code.
133-
This means that once your code is compiled, the resulting plain JS code has no type information.
132+
개략적으로, TypeScript의 컴파일러가 코드 검사를 마치면 타입을 _삭제해서_ 결과적으로 "컴파일된" 코드를 만듭니다.
133+
즉 코드가 한 번 컴파일되면, 결과로 나온 일반 JS 코드에는 타입 정보가 없습니다.
134134

135-
This also means that TypeScript never changes the _behavior_ of your program based on the types it inferred.
136-
The bottom line is that while you might see type errors during compilation, the type system itself has no bearing on how your program works when it runs.
135+
타입 정보가 없는 것은 TypeScript가 추론한 타입에 따라 프로그램의 _특성_을 변화시키지 않는다는 의미입니다.
136+
결론적으로 컴파일 도중에는 타입 오류가 표출될 수 있지만, 타입 시스템 자체는 프로그램이 실행될 때 작동하는 방식과 관련이 없습니다.
137137

138-
Finally, TypeScript doesn't provide any additional runtime libraries.
139-
Your programs will use the same standard library (or external libraries) as JavaScript programs, so there's no additional TypeScript-specific framework to learn.
138+
마지막으로, TypeScript는 추가 런타임 라이브러리를 제공하지 않습니다.
139+
TypeScript는 프로그램은 JavaScript 프로그램과 같은 표준 라이브러리 (또는 외부 라이브러리)를 사용하므로, TypeScript 관련 프레임워크를 추가로 공부할 필요가 없습니다.
140140
<!--
141141
Should extend this paragraph to say that there's an exception of
142142
allowing you to use newer JS features and transpile the code to an older
@@ -145,25 +145,25 @@ with an example --- something like `?.` would be good in showing readers
145145
that this document is maintained.)
146146
-->
147147

148-
## Learning JavaScript and TypeScript
148+
## JavaScript와 TypeScript 학습 (Learning JavaScript and TypeScript)
149149

150-
We frequently see the question "Should I learn JavaScript or TypeScript?".
150+
종종 "JavaScript 또는 TypeScript를 배워야 할까요?"와 같은 질문을 볼 수 있습니다.
151151

152-
The answer is that you can't learn TypeScript without learning JavaScript!
153-
TypeScript shares syntax and runtime behavior with JavaScript, so anything you learn about JavaScript is helping you learn TypeScript at the same time.
152+
정답은 JavaScript를 배우지 않고선 TypeScript를 배울 수 없다는 것입니다!
153+
TypeScript는 JavaScript와 구문과 런타임 특성을 공유하므로, JavaScript에서 배운 모든 것들은 동시에 TypeScript를 배울 때 도움이 될 것입니다.
154154

155-
There are many, many resources available for programmers to learn JavaScript; you should _not_ ignore these resources if you're writing TypeScript.
156-
For example, there about 20 times more StackOverflow questions tagged `javascript` than `typescript`, but _all_ of the `javascript` questions also apply to TypeScript.
155+
프로그래머들을 위한 JavaScript 학습 자원이 많습니다; TypeScript를 작성할 때 그런 학습 자원을 무시해선 _안됩니다_.
156+
예를 들어 `javascript`태그가 붙은 질문이 `typescript`태그가 붙은 질문보다 약 20배는 많지만, _모든_ `javascript`질문은 TypeScript에도 적용할 수 있습니다.
157157

158-
If you find yourself searching for something like "how to sort a list in TypeScript", remember: **TypeScript is JavaScript's runtime with a compile-time type checker**.
159-
The way you sort a list in TypeScript is the same way you do so in JavaScript.
160-
If you find a resource that uses TypeScript directly, that's great too, but don't limit yourself to thinking you need TypeScript-specific answers for everyday questions about how to accomplish runtime tasks.
158+
만약 "TypeScript에서 리스트를 정렬하는 법"과 같은 것을 찾는 경우, 기억하세요: **TypeScript는 컴파일-타임 타입 검사자가 있는 JavaScript의 런타임입니다**.
159+
리스트를 TypeScript에서 정렬하는 방법은 JavaScript에서 똑같은 방법으로 할 수 있습니다.
160+
만약 TypeScript를 직접적으로 사용하는 자원을 찾았다면 그것도 좋지만, 런타임 작업을 실행하기 위한 일상적인 질문을 TypeScript 관련 답변에만 제한시킬 필요는 없습니다.
161161

162162
---
163163

164-
From here, we'd recommend learning some of the JavaScript fundamentals (the [JavaScript guide at the Mozilla Web Docs](https://developer.mozilla.org/docs/Web/JavaScript/Guide) is a good starting point.)
164+
여기서, JavaScript 기초 몇 가지를 배우는 것을 추천합니다 ([Mozilla 웹 문서의 JavaScript 가이드](https://developer.mozilla.org/docs/Web/JavaScript/Guide)가 괜찮겠네요.)
165165

166-
Once you're feeling comfortable, you can come back to read [TypeScript for JavaScript Programmers](/docs/handbook/typescript-in-5-minutes.html), then start on [the handbook](/docs/handbook/intro.html) or explore the [Playground examples](/play#show-examples).
166+
익숙해지셨다면, 다시 돌아와서 [JavaScript 프로그래머들을 위한 TypeScript](/docs/handbook/typescript-in-5-minutes.html)을 읽어보시고, [핸드북](/docs/handbook/intro.html)을 시작하시거나 [예제](/play#show-examples)를 보세요.
167167

168168
<!-- Note: I'll be happy to write the following... -->
169169
<!--

0 commit comments

Comments
 (0)