3. 공부하는 방법
• 영어 문장과 단어 뜻을 보고, 의미를 잠깐
생각해 봅니다.
• 다음 장으로 넘어가서, 내가 생각한 의미와
비교해 봅니다.
4. 주의하세요.
• 슬라이드가 약 270장입니다.
• 어떤 분은 10분동안 집중해서 읽으셨는데 70 슬라이드
보셨다고 했어요.
• 한번에 다 보겠다 욕심내지 마시고, 건강 안구생활을 위
하여 한 10분 보시고, 드라마 한편 보시고, 또 10분 보
시고…
5. 부탁합니다
• 좀 보시고 나서,
– 공부하기에 도움이 되는 것 같다..
– 또는 이러면 더 도움이 될 것 같다..
– 이렇게 공부했더니 도움이 되더라, 등등 생각드는게 있으시면,
• 개영페북에 코멘트 부탁해용
https://www.facebook.com/groups/engfordev/permalin
k/661981877186974/
7. Basic JavaScript
for the impatient programmer
인내심 없는
프로그래머를 위한
자바스크립트 기초
patient : 인내심 많은
impatient: 인내심 없는
8. “Basic JavaScript” is
the most complete and concise
write up that I am aware of.
concise : 간결한
write up : 문서
I am aware of (A) : 나는
(A)에 대해 인지하고 있다.
9. “Basic JavaScript” is
the most complete and concise
write up that I am aware of.
"기초 자바스크립트"..는
내가 알고 있는 것중
가장 완전하고 간결한 글이다.
concise : 간결한
write up : 문서
I am aware of (A) : 나는
(A)에 대해 인지하고 있다.
10. This blog post enables you
to get started with JavaScript
as quickly as possible.
to enable (A) to (B) : (A)
가 (B)하게 해주다.
as quickly as possible:
최대한 빨리
get started with : ~을 하
기 시작하다.
11. This blog post enables you
to get started with JavaScript
as quickly as possible.
이 블로그 포스트는
여러분이 자바스크립트를
최대한 빨리
시작할 수 있도록 해준다.
to enable (A) to (B) : (A)
가 (B)하게 해주다.
as quickly as possible:
최대한 빨리
get started with : ~을 하
기 시작하다.
12. – if you already know how to program.
already : 이미
13. – if you already know how to program.
- 이미 프로그램을 짤 줄 안다면
already : 이미
14. This post describes
the smallest subset of the language
to describe : 기술하다
the smallest : 가장 작은
subset : 부분집합
15. This post describes
the smallest subset of the language
이 블로그 포스트는
자바스크립트언어의
가장 작은 부분집합을
기술합니다.
to describe : 기술하다
the smallest : 가장 작은
subset : 부분집합
16. This post describes
the smallest subset of the language
that allows you to be productive.
It allows you to be
productive. 그것은 여러
분이 생산성이 높도록 해
줍니다.
17. This post describes
the smallest subset of the language
that allows you to be productive.
이 블로그포스트는
It allows you to be
이 언어중에서도
분이 생산성이 높도록 해
여러분의 생산성을 높여주는
가장 작은 부분집합을 기술합니다.
productive. 그것은 여러
줍니다.
18. I call that subset “Basic JavaScript”
I call you baby.
나는 당신을 baby라고 부
른다.
19. I call that subset “Basic JavaScript”
저는 그 부분집합을
“자바스크립트 기초"라고
부르는 거구요.
I call you baby.
나는 당신을 baby라고 부
른다.
20. And I recommend to program in it
for a while.
for a while: 당분간
21. And I recommend to program in it
for a while.
그리고 저는 당분간은
그것(Basic JavaScript) 내에서
프로그래밍하기를 권합니다.
for a while: 당분간
22. , before moving on
to more details and advanced topics.
to move on : 넘어가다.
나아가다.
23. , before moving on
to more details and advanced topics.
좀 더 자세하고, 어려운 내용으로
넘어가기 전에는 말이죠.
to move on : 넘어가다.
나아가다.
24. I call that subset “Basic JavaScript” and
recommend to program in it for a while,
before moving on to more details and
advanced topics.
25. I call that subset “Basic JavaScript” and
recommend to program in it for a while,
before moving on to more details and
advanced topics.
저는 그 부분집합을 "자바스크립트 기초"
라고 부르며,
당분간은 이것 내에서 프로그래밍하기를
권합니다.
좀 더 자세하고 어려운 내용으로 나아가기
전에는 말이죠.
33. Warning: Below,
I‟m describing
rules of thumbs and best practices.
주의: 아래에서,
저는
대략적인 규칙과 모범 사례를
기술하고 있습니다.
below: 아래에서
to describe : 기술하다
rule-of-thumb : 대충이
지만 실제에 근거한 방법
34. I favor clarity over precision.
to favor (A) over (B):
(A)를 선호하다, (B)보다
35. I favor clarity over precision.
저는
정밀한 것보다는
명료한 것을 선호합니다.
to favor (A) over (B):
(A)를 선호하다, (B)보다
36. The rules are safe,
but a matter of taste.
a matter of taste :
취향의 문제
37. The rules are safe,
but a matter of taste.
제가 제시하는 규칙들은 안전합니
다만,
(사용할지 여부는) 취향의 문제죠.
a matter of taste :
취향의 문제
41. Whenever I introduce a new concept,
whenever I do it : 내가
그것을 할 때 마다
concept : 개념
42. Whenever I introduce a new concept,
제가 새로운 개념을
whenever I do it : 내가
소개할 때 마다
concept : 개념
그것을 할 때 마다
43. I try to illustrate it
via an interaction.
I try to illustrate :
묘사하려고 노력합니다.
44. I try to illustrate it
via an interaction.
저는 그것을
인터렉션을 통해서
보여주려고 노력합니다.
I try to illustrate :
묘사하려고 노력합니다.
45. Whenever I introduce a new concept,
I try to illustrate it
via an interaction
in a JavaScript command line.
46. Whenever I introduce a new concept,
I try to illustrate it
via an interaction
in a JavaScript command line.
제가 새로운 개념을 소개할 때 마다,
자바스크립트 커맨드 라인에서
인터렉션을 통해서 보여주려고 합니다.
71. , which should make it clear how they work.
그것은
그들이 어떻게 작동하는지 명확할
것입니다.
72. Sometimes,
you see functions and methods in action,
which should make it clear how they work.
in action : 작동하는
make it clear : 명확히 하
다.
73. Sometimes,
you see functions and methods in action,
which should make it clear how they work.
때때로, 여러분은 함수와 메서드가
작동하는 것을 볼 텐데요,
그들이 어떻게 작동하는지는 명확
할 겁니다.
in action : 작동하는
make it clear : 명확히 하
다.
74. There are links to pages,
where you can look up the details.
look up : 정보 등을 검색
해서 찾아보다.
75. There are links to pages,
where you can look up the details.
페이지로 가는 링크가 있습니다,
그곳에서 여러분은 세부사항을 찾
아볼 수 있고요.
look up : 정보 등을 검색
해서 찾아보다.
76. If not,
there are links to pages of the Mozilla
Developer Network,
where you can look up the details.
77. If not,
there are links to pages of the Mozilla
Developer Network,
where you can look up the details.
그렇지 않다면(명확하지 않다면),
모질라 개발자 네트워크 페이지로 가
는 링크가 있습니다,
그곳에서 여러분은 상세한 내용을 찾
을 수 있어요.
79. Additionally,
you can use Google
to find documentation on MDN.
그리고,
여러분은 구글을 사용할 수 있습니다,
MDN상의 문서를 검색하기 위해서 말
이죠.
80. For example,
the following Google search finds the
documentation
for the push() method of arrays:
mdn array push
following : 아래 나오는
81. For example,
the following Google search finds the
documentation
for the push() method of arrays:
mdn array push
following : 아래 나오는
예를 들어,
아래의 구글검색어는
문서를 검색합니다,
배열의 push() 메서드가 나온 문서를요.
mdn array push
83. This section
gives a little background
on the nature of JavaScript,
이 섹션은
약간의 배경지식을 제공합니다.
자바스크립트의 속성에 대한 배경
지식을요,
background on:
~에 대한 배경지식
84. , to help you understand
why it is the way it is.
85. , to help you understand
why it is the way it is.
그것이 왜 그렇게 생겨먹었는지
여러분이 이해하는 것을 돕기 위해..
86. This section gives a little background on
the nature of JavaScript, to help you
understand why it is the way it is.
87. This section gives a little background on
the nature of JavaScript, to help you
understand why it is the way it is.
이 섹션에서는,
자바스크립트가 왜 그렇게 생겨먹었는
지 여러분이 이해하는 것을 돕기 위해,
자바스크립트의 속성에 대한 약간의
배경지식을 제공합니다.
89. The programming language is called
JavaScript,
the language standard is called
ECMAScript.
(A) is called (B).
(B) (A)는 (B)라고 불린다.
90. The programming language is called
JavaScript,
the language standard is called
ECMAScript.
프로그래밍 언어는 자바스크립트라고 불리고,
(A) is called (B).
언어 표준은 ECMA 스크립트라고 불립니다.
(B) (A)는 (B)라고 불린다.
91. They have different names,
because there is a trademark on “Java”
(held by Oracle).
92. They have different names,
because there is a trademark on “Java”
(held by Oracle).
그들은 서로 다른 이름을 갖고 있습니다,
왜냐하면 “Java”가 등록된 상표이기 때문이죠.
(오라클이 들고 있는).
94. Only Mozilla is allowed
to use the name “JavaScript”.
모질라만 “자바스크립트”라는
이름을 사용해도 됩니다.
95. At the moment,
only Mozilla is allowed to officially use the
name “JavaScript”,
because they received a license long ago.
at the moment : 현재는
officially : 공식적으로
received : 받았다
long ago : 오래 전에
96. At the moment,
only Mozilla is allowed to officially use the
name “JavaScript”,
because they received a license long ago.
현재는,
모질라만이 “자바스크립트”라는 이름
을 공식적으로 사용할 수 있습니다,
왜냐하면 오래전에 라이센스를 받았기
때문이죠.
at the moment : 현재는
officially : 공식적으로
received : 받았다
long ago : 오래 전에
97. Therefore,
an open language standard
had to have a different name.
therefore : 따라서
had to have (A) :
(A)를 가져야 했다.
98. Therefore,
an open language standard
had to have a different name.
따라서,
공개된 언어 표준은
다른 이름을 가져야 했습니다.
therefore : 따라서
had to have (A) :
(A)를 가져야 했다.
99. The current version of JavaScript is
ECMAScript 5,
ECMAScript 6 is currently being developed.
current version:
현재 버전
currently : 현재
100. The current version of JavaScript is
ECMAScript 5,
ECMAScript 6 is currently being developed.
자바스크립트의 현재버전은 ECMA
스크립트 5이며,
ECMA스크립트 6은 현재 개발되는
중입니다.
current version:
현재 버전
currently : 현재
102. JavaScript‟s creator
had no choice but to create the language
very quickly
had no choice but to
create (A):
(A)를 만드는 것 말고는
선택의 여지가 없었다
103. JavaScript‟s creator
had no choice but to create the language
very quickly
자바스크립트를 만든 이는
그 언어를
매우 빨리 만드는 것 외에는
달리 선택의 여지가 없었습니다.
had no choice but to
create (A):
(A)를 만드는 것 말고는
선택의 여지가 없었다
104. (or other, worse, technologies would have
been used).
or : 그렇지 않았다면,
(A) would have been
used.
(A)가 사용되었을 것입니
다.
worse : 더 안 좋은
105. (or other, worse, technologies would have
been used).
그렇지 않았다면, 다른, 더 안 좋은,
or : 그렇지 않았다면,
기술들이 사용되었을 것입니다.
(A) would have been
used.
(A)가 사용되었을 것입니
다.
worse : 더 안 좋은
106. JavaScript‟s creator, Brendan Eich,
had no choice but to create the language
very quickly (or other, worse, technologies
would have been used at Netscape).
or : 그렇지 않았다면,
(A) would have been
used :
(A)가 사용되어왔을 것입
니다.
107. JavaScript‟s creator, Brendan Eich,
had no choice but to create the language
very quickly (or other, worse, technologies
would have been used at Netscape).
자바스크립트의 창시자인, 브렌단 아이히
or : 그렇지 않았다면,
는 그 언어를 빨리 만들어내는 것 외에는
(A) would have been
선택의 여지가 없었습니다. ( 그렇지 않았
다면, 다른, 더 안 좋은, 기술들이 넷스케
이프에서 사용되었을 것입니다.)
used :
(A)가 사용되어왔을 것입
니다.
108. He borrowed from several programming
languages:
borrow : 빌리다.
several : 몇몇
109. He borrowed from several programming
languages:
그는 몇몇 프로그래밍 언어로부터
빌려왔습니다.
borrow : 빌리다.
several : 몇몇
110. Java is the cause of JavaScript‟s syntax.
cause : 원인
111. Java is the cause of JavaScript‟s syntax.
자바는
자바스크립트 문법(syntax)의 원인입니다.
(자바스크립트의 문법은 자바에서 따왔습니
다. .는 의미인듯요)
cause : 원인
112. Java is the cause of
how JavaScript partitions values
into primitives and objects.
to partition: 분할하다.
나누다.
113. Java is the cause of
how JavaScript partitions values
into primitives and objects.
자바는 자바스크립트가 값을 primitives
to partition: 분할하다.
와 objects로 나누는 방식의 원인입니다.
나누다.
(자바스크립트가 값을 primitive와
objects로 나누는 방식은 자바에서 따왔
습니다…는 의미로 이해했음요)
114. Java is the cause of JavaScript‟s syntax
and of how it partitions values into
primitives and objects.
115. Java is the cause of JavaScript‟s syntax
and of how it partitions values into
primitives and objects.
자바는 자바스크립트의 문법과, 자바
스크립트가 값을 primitives와
objects로 나누는 방식의 원인입니다.
(이 두 가지는 자바에서 따왔습니다.)
116. Scheme and AWK inspired JavaScript‟s
handling of functions.
handling : 다루는 것
inspire : 영감을 주다.
117. Scheme and AWK inspired JavaScript‟s
handling of functions.
Scheme과 AWK는
handling : 다루는 것
자바스크립트가 함수를 다루는 방식에
inspire : 영감을 주다.
영감을 주었습니다.
118. Scheme and AWK inspired JavaScript‟s
handling of functions
– they are first-class and used frequently in
the language.
first-class : 최고의, 일류
의
frequencly : 빈번하게
119. Scheme and AWK inspired JavaScript‟s
handling of functions
– they are first-class and used frequently in
the language.
Scheme과 AWK는 자바스크립트
가 함수를 다루는 방식에 영감을 주
었습니다 – 이 두개 언어는 최고 수
준이며, 자바스크립트 언어에서 빈
번하게 사용됩니다.
first-class : 최고의, 일류
의
frequencly : 빈번하게
121. Closures make them a powerful tool.
Clousres는 그들을 강력한 도구로
만들어줍니다.
(Closure 덕분에 그들은 매우 강력
한 도구가 됩니다.)
122. Self is responsible for JavaScript‟s unique
style of object-oriented programming
(OOP).
(A) is responsible for
(B) :
(A)는 (B)의 원인이 다.
unique : 독특한
123. Self is responsible for JavaScript‟s unique
style of object-oriented programming
(OOP).
Self는 자바스크립트의 고유한
OOP 스타일의 원인이 됩니다.
(Self가 있기에, 자바스크립트는 고
유한 OOP 스타일을 갖습니다.)
(A) is responsible for
(B) :
(A)는 (B)의 원인이 다.
unique : 독특한
124. Its core is elegant,
some of the things built on top of that core
are less so.
elegant : 명쾌한
125. Its core is elegant,
some of the things built on top of that core
are less so.
자바스크립트의 코어는 명쾌하며,
그 코어의 위에 만들어진 것들 중
몇몇은 덜 명쾌합니다.
elegant : 명쾌한
126. Its core (which we can‟t go into here) is
elegant, some of the things built on top of
that core are less so.
go into : 들어가다
127. Its core (which we can‟t go into here) is
elegant, some of the things built on top of
that core are less so.
자바스크립트의 코어 (여기서는 다
룰 수 없지만)는 명쾌합니다, 그 코
어 위에 만들어진 것들 중 몇몇은
덜 명쾌합니다.
go into : 들어가다
128. A killer feature is
that you can create objects, directly.
killer feature : 인상적인
기능
direcly : 바로, 즉시
129. A killer feature is
that you can create objects, directly.
인상적인 기능 하나는
오브젝트를 바로 생성할 수 있다는
것입니다.
killer feature : 인상적인
기능
direcly : 바로, 즉시
130. A killer feature of JavaScript OOP
is that you can create objects, directly.
131. A killer feature of JavaScript OOP
is that you can create objects, directly.
자바스크립트 OOP의
인상적인 기능 하나는,
오브젝트를 바로 생성할 수 있다는
것입니다.
132. There is no need to create a class first.
There is no need to
create (A) :
(A)를 만들 필요가 없습니
다.
first : 먼저
133. There is no need to create a class first.
먼저 클래스를 만들 필요가 없습니
There is no need to
다. (오브젝트를 만들기 전에)
create (A) :
(A)를 만들 필요가 없습니
다.
first : 먼저
134. There is no need to create
a class or something similar
first.
something similar : 그
비슷한 뭔가
135. There is no need to create
a class or something similar
first.
클래스나 그 비슷한 뭔가를
먼저 만들 필요가 없습니다.
(오브젝트를 만들기 전에)
something similar : 그
비슷한 뭔가
136. Perl and Python influenced JavaScript‟s
handling of strings
influenced : 영향을 주었
다.
137. Perl and Python influenced JavaScript‟s
handling of strings
펄과 파이썬은
influenced : 영향을 주었
자바스크립트가 문자열을 다루는 방식에
다.
영향을 주었습니다.
138. Perl and Python influenced JavaScript‟s
handling of strings, arrays and regular
expressions.
139. Perl and Python influenced JavaScript‟s
handling of strings, arrays and regular
expressions.
펄과 파이선은
자바스크립트가
문자열, 배열, 정규표현식을
다루는데 영향을 주었습니다.
141. JavaScript
did not have exception handling
until ECMAScript 3
자바스크립트는
ECMA스크립트 3 이전까지는
예외 처리기능이 없었습니다.
until (A) : (A) 전까지는..
142. ,which explaines why the language fails
silently
automatically : 자동으로
fail : 작동이 안되다. 고장
나다.
143. ,which explaines why the language fails
silently
, 그리고 그것은 자바스크립트가 왜
조용히 고장나는지 설명해줍니다.
automatically : 자동으로
fail : 작동이 안되다. 고장
나다.
144. , which explains why the language so often
automatically converts values and so often
fails silently:
explain : 설명해주다
convert values : 값을 변
환하다.
fail : 작동이 안되다.
145. , which explains why the language so often
automatically converts values and so often
fails silently:
, 이것은 왜 자바스크립트가
그렇게 자주 자동으로 값을 변환하
고선, 그렇게 자주 조용히 작동에
실패하는지 설명해 줍니다.
explain : 설명해주다
convert values : 값을 변
환하다.
fail : 작동이 안되다.
147. it initially couldn‟t throw exceptions.
자바스크립트는 처음에는 예외처
리를 할 수 없었던 겁니다.
initially : 처음에
148. JavaScript did not have exception handling until
ECMAScript 3, which explains why the
language so often automatically converts
values and so often fails silently: it initially
couldn‟t throw exceptions.
149. JavaScript did not have exception handling until
ECMAScript 3, which explains why the
language so often automatically converts
values and so often fails silently: it initially
couldn‟t throw exceptions.
자바스크립트는 ECMA 스크립트 3 이전
까지는 예외처리기능이 없었습니다, 이는
왜 이 언어가 자동으로 값을 변환하고선
그렇게 자주 조용히 작동에 실패하는지 설
명해주죠: 처음에는 예외처리를 해줄 수
없었던 거죠.
150. On one hand, JavaScript has quirks
and is missing
quite a bit of functionality
on one hand : 한편으로는
quirk : 별난 점
is missing (A) : (A)가 없다.
quite a bit : 상당히 많은
functionality : 기능
151. On one hand, JavaScript has quirks
and is missing
quite a bit of functionality
한편으로,
자바스크립트는 별난 점들이 있고요,
꽤 많은 기능이 없습니다.
on one hand : 한편으로는
quirk : 별난 점
is missing (A) : (A)가 없다.
quite a bit : 상당히 많은
functionality : 기능
152. On one hand, JavaScript has quirks and is
missing quite a bit of functionality
(block-scoped variables, modules, support
for subtyping, etc.).
153. On one hand, JavaScript has quirks and is
missing quite a bit of functionality
(block-scoped variables, modules, support
for subtyping, etc.).
한편으로는, 자바스크립트는 별난
점들이 있고, 꽤 많은 기능이 없습
니다. (block-scoped 변수, 모듈,
subtyping 지원 등등)
154. On the other hand, it has several powerful
features.
on the other hand : 다
른 한편으로는
155. On the other hand, it has several powerful
features.
다른 한편으로는,
자바스크립트는 몇 가지 강력한 기
능들이 있습니다.
on the other hand : 다
른 한편으로는
156. It has powerful features
that allow you
to work around these problems.
to work around a
problem : 문제를 성공적
으로 다루다.
157. It has powerful features
that allow you
to work around these problems.
자바스크립트는
to work around a
여러분이 이런 문제들을 해결하도록 해주는
problem : 문제를 성공적
강력한 기능들이 있습니다..
으로 다루다.
158. On the other hand, it has several powerful
features that allow you to work around
these problems.
159. On the other hand, it has several powerful
features that allow you to work around
these problems.
다른 한편으로는, 자바스크립트는
여러분이 이런 문제들을 성공적으
로 해결하도록 해주는 강력한 기능
들이 몇 가지 있습니다.
163. In JavaScript,
you often learn patterns, instead.
자바스크립트의 경우,
(언어 특징) 대신에
보통 패턴을 배웁니다.
instead : 대신에
164. Further reading
JavaScript: how it all began
JavaScript: the glass is half full [what makes JavaScript appealing?]
ECMAScript: ES.next versus ES 6 versus ES Harmony [includes a brief
history of ECMAScript versions]
Perl and Python influences in JavaScript
appealing : 매력적인
brief history : 간략한 역
사
165. Further reading
JavaScript: how it all began
JavaScript: the glass is half full [what makes JavaScript appealing?]
ECMAScript: ES.next versus ES 6 versus ES Harmony [includes a brief
history of ECMAScript versions]
Perl and Python influences in JavaScript
더 읽을 거리
appealing : 매력적인
자바스크립트: 이모든 것 어케 시작되었나.
brief history : 간략한 역
자바스크립트: 컵은 절반이나 차 있다. [자바스크립트, 왜
사
매력있나?]
ECMA스크립트: ES.next 대 ES 6 대 ES Harmony
[ECMA스크립트 버전의 간략한 역사]
자바스크립트에 미친 펄과 파이썬의 영향
170. To understand JavaScript‟s syntax,
it helps to know that it has two categories.
it helps to know : ~을 아
는 것이 도움이 된다.
171. To understand JavaScript‟s syntax,
it helps to know that it has two categories.
자바스크립트의 문법을 이해하기 위해서는,
it helps to know : ~을 아
자바스크립트가 두개의 카테고리를 갖는다
는 것이 도움이 된다.
는 점을 아는 것이 도움이 됩니다.
172. To understand JavaScript‟s syntax, it helps
to know that (simplifyingly), it has two
major syntactic categories: statements and
expressions.
simplifyingly : 단순화해
서
major categories : 큰 카
테고리
173. To understand JavaScript‟s syntax, it helps
to know that (simplifyingly), it has two
major syntactic categories: statements and
expressions.
자바스크립트의 문법을 이해하기 위해
서는, (단순화해서) 자바스크립트가 두
개의 큰 통사적 범주를 갖고 있다는 점
을 알면 도움이 됩니다: 바로
statement와 expression입니다.
simplifyingly : 단순화해
서
major categories : 큰 카
테고리
176. A program is a sequence of statements.
sequence : 연속적인 사
건들
177. A program is a sequence of statements.
프로그램은
statement들의 연속입니다.
sequence : 연속적인 사
건들
178. Example of a statement, which declares
(creates) a variable foo:
var foo;
declare : 선언하다
variable foo: 변수 foo
179. Example of a statement, which declares
(creates) a variable foo:
var foo;
statement의 예, 변수 foo를 선언하는
declare : 선언하다
statement:
variable foo: 변수 foo
var foo;
188. The distinction between statements and
expressions
statements와 expression간의 구분
distinction : 구분
189. The distinction is best illustrated by the
fact.
is best illustrated by
(A) : (A)에 의해 가장 잘
묘사된다.
190. The distinction is best illustrated by the
fact.
이 구분은
그 사실에 의해 가장 잘 묘사됩니다.
is best illustrated by
(A) : (A)에 의해 가장 잘
묘사된다.
191. the fact that
JavaScript has two different ways
to do if-then-else
fact : 사실
two different ways: 두
가지 방식
192. the fact that
JavaScript has two different ways
to do if-then-else
자바스크립트가
if-then-else를 수행하는
두 가지 방식을 가진다는 사실
fact : 사실
two different ways: 두
가지 방식
193. The distinction between statements and
expressions is best illustrated by the fact
that JavaScript (like Java) has two different
ways to do if-then-else.
like Java : 자바와 마찬
가지로
194. The distinction between statements and
expressions is best illustrated by the fact
that JavaScript (like Java) has two different
ways to do if-then-else.
statement와 expression간의 구
분은, 자바스크립트가 if-then-else
를 수행하는 두 가지 방식을 가진다
는 사실에 의해 가장 잘 묘사됩니다.
like Java : 자바와 마찬
가지로
195. Either as a statement:
var x;
if (y >= 0) {
x = y;
} else {
x = -y;
}
Or as an expression:
var x = y >= 0 ? y : -y;
Either (A) or (B) :
(A)가 되었든, (B)가 되었
든
196. Either as a statement:
var x;
if (y >= 0) {
x = y;
} else {
x = -y;
}
Or as an expression:
var x = y >= 0 ? y : -y;
statement로 썼을 때든:
Either (A) or (B) :
(A)가 되었든, (B)가 되었
든
아니면 expression로 썼을 때든:
197. You can use the latter
as a function argument
(but not the former):
myFunction(y >= 0 ? y : -y)
the latter : 후자
the former : 전자
198. You can use the latter
as a function argument
(but not the former):
myFunction(y >= 0 ? y : -y)
후자는 함수의 인자로 사용할 수 있지만
the latter : 후자
(전자는 함수의 인자로 사용할 수 없습니다):
the former : 전자
200. Lastly,
wherever JavaScript expects a statement,
you can also use an expression.
마지막으로,
자바스크립트가 statement를 기대
하는 곳이면 어디에서나,
expression도 사용할 수 있습니다.
lastly : 마지막으로
wherever : 어디에서나
expect : 기대하다
202. For example:
foo(bar(7, 1));
foo(...); is a statement
(a so-called expression statement),
bar(7, 1) is an expression.
예를 들어:
foo (bar (7, 1));
foo (…); 는 statement 입니다.
(소위 expression statement이죠),
그리고 bar (7,1)는 expression입니다.
so-called : 소위
211. However, any statement
can always be replaced by a block.
하지만,
모든 statement는
항상 block으로 대체될 수 있습니
다.
be replaced : 대체되다.
212. a block, curly braces containing zero or
more statements
213. a block, curly braces containing zero or
more statements
블록, 0개 이상의 statement를 포
함하는 { }
214. However, any statement
can always be replaced by a block,
curly braces containing zero or more
statements.
215. However, any statement
can always be replaced by a block,
curly braces containing zero or more
statements.
하지만,
statement는 항상 블록으로 대체될 수
있습니다, 블록은 0개 이상의
statement를 포함하는 { } 이고요.
216. Thus, you could also write:
if (obj !== null) {
obj.foo();
}
while (x > 0) {
x--;
}
thus : 따라서
You could write : 이렇게
쓸 수 있겠죠.
217. Thus, you could also write:
if (obj !== null) {
obj.foo();
}
while (x > 0) {
x--;
}
따라서, 이렇게 쓸 수도 있겠죠:
if (obj !== null) {
obj.foo();
}
while (x > 0) {
x--;
}
thus : 따라서
You could write : 이렇게
쓸 수 있겠죠.
218. In this blog post, we only use the latter
form of control flow statements.
the latter form : 후자의
형태
219. In this blog post, we only use the latter
form of control flow statements.
이 블로그 포스트에서는,
control flow statement의 형태중,
후자만을 사용합니다.
the latter form : 후자의
형태
223. But omitting them can lead to surprises,
which is why I recommend against doing it.
omitting (A) : (A)를 생략
하는 것
lead to (A) : (A)로 이어
지다.
recommand against
doing it : 그것 하는 것을
하지 말라고 권하다.
224. But omitting them can lead to surprises,
which is why I recommend against doing it.
하지만 세미콜론을 생략하는 것은
놀람으로 이어질 수 있습니다,
omitting (A) : (A)를 생략
하는 것
lead to (A) : (A)로 이어
그것이 제가 생략하지 말라고 권하
지다.
는 이유입니다.
recommand against
doing it : 그것 하는 것을
하지 말라고 권하다.
225. As you can see above,
semicolons terminate statements,
but not blocks.
As you can see above :
위에서 보듯이
terminate : 종료시키다.
226. As you can see above,
semicolons terminate statements,
but not blocks.
위에서 보듯이,
세미콜론은 statement를 종료시키고,
block을 종료시키지는 않습니다.
(block뒤에는 세미콜론을 안 씁니다.)
As you can see above :
위에서 보듯이
terminate : 종료시키다.
227. There is one case where you will see a
semicolon after a block:
one case : 한 가지 경우
228. There is one case where you will see a
semicolon after a block:
block뒤에 세미콜론을 보게 되는 것은
딱 한 가지 경우가 있습니다:
one case : 한 가지 경우
229. A function expression is
an expression that ends with a block.
(A) ends with (B) : (A)는
(B)로 끝난다. 즉 (A)의 끝
에는 (B)가 나온다.
230. A function expression is
an expression that ends with a block.
function expression이란
block으로 끝나는 expression입니다.
(A) ends with (B) : (A)는
(B)로 끝난다. 즉 (A)의 끝
에는 (B)가 나온다.
231. If such an expression comes last in a statement,
it is followed by a semicolon:
var x = 3 * 7;
var f = function () { };
232. If such an expression comes last in a statement,
it is followed by a semicolon:
var x = 3 * 7;
var f = function () { };
statement에서 그런 expression
이 마지막에 오면,
그 뒤에 세미콜론이 나옵니다:
234. JavaScript has two kinds of comments:
single-line comments and multi-line
comments.
two kinds of
comments : 두 종류의
주석
235. JavaScript has two kinds of comments:
single-line comments and multi-line
comments.
자바스크립트에는 두 가지 종류의
주석이 있습니다:
한줄 주석과 여러 줄 주석
two kinds of
comments : 두 종류의
주석
236. Single-line comments start with //
and are terminated by the end of the line:
x++; // single-line comment
start with (A) : (A)로 시
작하다
terminated : 종료당하다.
237. Single-line comments start with //
and are terminated by the end of the line:
x++; // single-line comment
한줄 주석은 //로 시작하고,
그 줄의 끝에서 끝납니다.
start with (A) : (A)로 시
작하다
terminated : 종료당하다.
238. Multi-line comments are delimited by /* and
*/
/* This is
a multi-line
comment.
*/
delimited : 범위가 정해
지다.
239. Multi-line comments are delimited by /* and
*/
/* This is
a multi-line
comment.
*/
여러 줄 주석은 /*와 */로 범위가 정
해집니다.
delimited : 범위가 정해
지다.
241. Further reading
Expressions versus statements in JavaScript
Automatic semicolon insertion in JavaScript
더 읽을 거리
자바스크립트에서 expression 과
statement
자바스크립트에서 자동 세미콜론 삽입
246. You can declare a variable and assign a
value at the same time:
var foo = 6;
at the same time : 동시
에
247. You can declare a variable and assign a
value at the same time:
var foo = 6;
변수를 선언하고
동시에 값을 할당할 수 있습니다.
at the same time : 동시
에
248. You can also assign a value
to an existing variable:
foo = 4; // change variable `foo`
existing : 존재하는
249. You can also assign a value
to an existing variable:
foo = 4; // change variable `foo`
이미 존재하는 변수에다가
값을 할당할 수도 있습니다:
foo = 4; // „foo‟변수를 바꾼다.
existing : 존재하는
259. For example, the name of a variable is an
identifier.
예를 들어, 변수의 이름은 일종의
identifier입니다.
260. Roughly, the first character of an identifier
can be any Unicode letter, a dollar sign ($)
or an underscore (_).
261. Roughly, the first character of an identifier
can be any Unicode letter, a dollar sign ($)
or an underscore (_).
대략, identifier의 첫번째 문자는
Unicode문자나, $ 기호나, 언더바
모두 될 수 있습니다.
265. Thus, the following are all legal identifiers:
arg0
_tmp
$elem
π
따라서, 다음에 나오는 것은
모두 문법에 맞는 identifier입니다:
arg0
_tmp
$elem
π
266. Several identifiers are “reserved words” –
they are part of the syntax and can‟t be
used as variable names:
reserved : 예약된
267. Several identifiers are “reserved words” –
they are part of the syntax and can‟t be
used as variable names:
몇몇 identifier는 “미리 예약된 단
어”이다 –이들은 문법의 일부를 이
루며, 변수명으로 사용될 수 없습니
다.
reserved : 예약된
268. reserved words
arguments break case catch class const continue debugger default delete do else
enum eval export extends false finally for function if implements import in instanceof
interface let new null package private protected public return static super switch this
throw true try typeof var void while with yield
예약된 이름들
arguments break case catch class const continue
debugger default delete do else enum eval export
extends false finally for function if implements import
in instanceof interface let new null package private
protected public return static super switch this throw
true try typeof var void while with yield
269. Technically, the following three identifiers
are not reserved words, but shouldn‟t be
used as variable names, either:
Infinity NaN undefined
technically : 엄밀히 따
지자면
270. Technically, the following three identifiers
are not reserved words, but shouldn‟t be
used as variable names, either:
Infinity NaN undefined
다음에 나오는 세 가지 identifier는, 엄밀히
technically : 엄밀히 따
따지면, 예약된 이름은 아니지만,
지자면
변수명으로 사용되어서는 안됩니다.
Infinity NaN undefined