aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Park <parkgds@gmail.com>2022-01-11 20:50:14 +0900
committerGitHub <noreply@github.com>2022-01-11 20:50:14 +0900
commit8c8f6bda1505d2c09a3f149af8e7a3671ad926a1 (patch)
treee8edec9043be982cb6eb1ee00fd563104cec56fb
parent0da061fcf4f3143aa96dfc0f8552f4f2a49d464e (diff)
downloadtranslated-content-8c8f6bda1505d2c09a3f149af8e7a3671ad926a1.tar.gz
translated-content-8c8f6bda1505d2c09a3f149af8e7a3671ad926a1.tar.bz2
translated-content-8c8f6bda1505d2c09a3f149af8e7a3671ad926a1.zip
[ko] Improve translation for class hoisting (#3506)
-rw-r--r--files/ko/web/javascript/reference/classes/index.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/files/ko/web/javascript/reference/classes/index.html b/files/ko/web/javascript/reference/classes/index.html
index 59f72f7652..8bb836788a 100644
--- a/files/ko/web/javascript/reference/classes/index.html
+++ b/files/ko/web/javascript/reference/classes/index.html
@@ -24,13 +24,15 @@ translation_of: Web/JavaScript/Reference/Classes
<h4 id="Hoisting">Hoisting</h4>
-<p><strong>함수 선언</strong>과 <strong>클래스 선언</strong>의 중요한 차이점은 함수 선언의 경우 {{Glossary("Hoisting", "호이스팅")}}이 일어나지만, 클래스 선언은 그렇지 않다는 것입니다. 클래스를 사용하기 위해서는 클래스를 먼저 선언 해야 합니다. 그렇지 않으면, 다음 코드는 {{jsxref("ReferenceError")}}를 던질 것입니다. :</p>
+<p><strong>함수 선언</strong>과 <strong>클래스 선언</strong>의 중요한 차이점은 험수의 경우 정의하기 하기 전에 호출할 수 있지만, 클래스는 반드시 정의한 뒤에 사용할 수 있다는 점입니다. 다음 코드는 {{jsxref("ReferenceError")}}를 던질 것입니다.</p>
<pre class="brush: js example-bad notranslate">const p = new Rectangle(); // ReferenceError
class Rectangle {}
</pre>
+<p>예외가 발생하는 이유는 클래스가 {{Glossary("Hoisting", "호이스팅")}}될 때 초기화는 되지 않기 때문입니다.</p>
+
<h3 id="Class_표현식">Class 표현식</h3>
<p><strong>Class 표현식</strong>은 class를 정의하는 또 다른 방법입니다. Class 표현식은 이름을 가질 수도 있고, 갖지 않을 수도 있습니다. 이름을 가진 class 표현식의 이름은 클래스 body의 local scope에 한해 유효합니다. (하지만, 클래스의 (인스턴스 이름이 아닌) {{jsxref("Function.name", "name")}} 속성을 통해 찾을 수 있습니다).</p>