aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/functions
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/javascript/reference/functions')
-rw-r--r--files/ko/web/javascript/reference/functions/arguments/@@iterator/index.html78
-rw-r--r--files/ko/web/javascript/reference/functions/arguments/callee/index.html203
-rw-r--r--files/ko/web/javascript/reference/functions/arguments/caller/index.html93
-rw-r--r--files/ko/web/javascript/reference/functions/arguments/index.html189
-rw-r--r--files/ko/web/javascript/reference/functions/arguments/length/index.html74
-rw-r--r--files/ko/web/javascript/reference/functions/default_parameters/index.html239
-rw-r--r--files/ko/web/javascript/reference/functions/get/index.html179
-rw-r--r--files/ko/web/javascript/reference/functions/index.html596
-rw-r--r--files/ko/web/javascript/reference/functions/method_definitions/index.html230
-rw-r--r--files/ko/web/javascript/reference/functions/rest_parameters/index.html223
-rw-r--r--files/ko/web/javascript/reference/functions/set/index.html208
-rw-r--r--files/ko/web/javascript/reference/functions/애로우_펑션/index.html465
12 files changed, 2777 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/functions/arguments/@@iterator/index.html b/files/ko/web/javascript/reference/functions/arguments/@@iterator/index.html
new file mode 100644
index 0000000000..454c8111b8
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/arguments/@@iterator/index.html
@@ -0,0 +1,78 @@
+---
+title: 'arguments[@@iterator]()'
+slug: Web/JavaScript/Reference/Functions/arguments/@@iterator
+tags:
+ - Deprecated
+ - Functions
+ - JavaScript
+ - Property
+ - arguments
+translation_of: Web/JavaScript/Reference/Functions/arguments/@@iterator
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><code><strong>@@iterator</strong></code> 속성의 초기값은 {{jsxref("Array.prototype.values")}} 속성의 초기값과 같은 함수 객체입니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox"><var>arguments</var>[Symbol.iterator]()</pre>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="for...of_반복문을_사용한_반복"><code>for...of</code> 반복문을 사용한 반복</h3>
+
+<pre class="brush: js">function f() {
+ // 브라우저가 for...of 반복문과
+ // for 반복문 안의 let 범위의 변수를 지원해야 합니다.
+ for (let letter of arguments) {
+ console.log(letter);
+ }
+}
+f('w', 'y', 'k', 'o', 'p');
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-createunmappedargumentsobject', ' CreateUnmappedArgumentsObject')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-createmappedargumentsobject', ' CreateMappedArgumentsObject')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-createunmappedargumentsobject', 'CreateUnmappedArgumentsObject')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-createmappedargumentsobject', 'CreateMappedArgumentsObject')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.functions.arguments.@@iterator")}}</p>
+</div>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Array.prototype.values()")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/arguments/callee/index.html b/files/ko/web/javascript/reference/functions/arguments/callee/index.html
new file mode 100644
index 0000000000..13ab0c948d
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/arguments/callee/index.html
@@ -0,0 +1,203 @@
+---
+title: arguments.callee
+slug: Web/JavaScript/Reference/Functions/arguments/callee
+tags:
+ - Deprecated
+ - Functions
+ - JavaScript
+ - Property
+ - arguments
+translation_of: Web/JavaScript/Reference/Functions/arguments/callee
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><strong><code>arguments.callee</code></strong> 속성(property)은 현재 실행 중인 함수를 포함합니다.</p>
+
+<h2 id="설명">설명</h2>
+
+<p><code>callee</code>는 <code>arguments</code> 객체의 속성입니다. 그 함수의 몸통(body) 내에서 현재 실행 중인 함수를 참조하는 데 쓰일 수 있습니다. 이는 함수의 이름을 알 수 없는 경우에 유용합니다, 가령 이름 없는 함수 식(또한 "익명 함수"라 함) 내에서.</p>
+
+<div class="warning"><strong>경고:</strong> ECMAScript 제5판(ES5) 은 <a href="/ko/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="Strict mode">엄격 모드</a>에서 <code>arguments.callee()</code>의 사용을 금합니다. function 식(expression)에 이름을 주거나 함수 자체를 호출해야 하는 곳에 function 선언을 사용하여 <code>arguments.callee()</code> 사용을 피하세요.</div>
+
+<h3 id="arguments.callee는_왜_ES5_엄격_모드에서_제거되었나요"><code>arguments.callee</code>는 왜 ES5 엄격 모드에서 제거되었나요?</h3>
+
+<p>(<a href="http://stackoverflow.com/a/235760/578288" title="http://stackoverflow.com/a/235760/578288">olliej의 Stack Overflow 답변</a>에서 고쳐씀)</p>
+
+<p>초기 버전 JavaScript는 유명(named) 함수 식을 허용하지 않습니다. 그리고 이 때문에 재귀(recursive) 함수 식을 만들 수 없습니다.</p>
+
+<p>예를 들어, 이 구문은 작동됩니다:</p>
+
+<pre class="brush: js">function factorial (n) {
+ return !(n &gt; 1) ? 1 : factorial(n - 1) * n;
+}
+
+[1,2,3,4,5].map(factorial);</pre>
+
+<p>하지만 다음은:</p>
+
+<pre class="brush: js">[1,2,3,4,5].map(function (n) {
+ return !(n &gt; 1) ? 1 : /* what goes here? */ (n - 1) * n;
+});</pre>
+
+<p>아닙니다. 이를 우회하기 위해 <code>arguments.callee</code>가 추가되었고 이와 같이 할 수 있습니다</p>
+
+<pre class="brush: js">[1,2,3,4,5].map(function (n) {
+ return !(n &gt; 1) ? 1 : arguments.callee(n - 1) * n;
+});</pre>
+
+<p>그러나, 이는 실로 정말 나쁜 해결책이었습니다. 이는 (다른 <code>arguments</code>, <code>callee</code> 및 <code>caller</code> 문제와 함께) 일반적인 경우에 인라인 및 tail 재귀를 불가능케 하기에 (tracing 등을 통해 선택한 경우에 그것을 달성할 수 있지만 최고의 코드는 검사가 달리 필요하지 않기에 차선입니다.) 다른 주요 문제는 그 재귀 호출이 다른 <code>this</code> 값을 갖는 것입니다. 가령:</p>
+
+<pre class="brush: js">var global = this;
+
+var sillyFunction = function (recursed) {
+ if (!recursed) { return arguments.callee(true); }
+ if (this !== global) {
+ alert("This is: " + this);
+ } else {
+ alert("This is the global");
+ }
+}
+
+sillyFunction();</pre>
+
+<p>ECMAScript 3은 유명(named) 함수 식을 허용해서 이 문제를 해결했습니다. 예를 들면:</p>
+
+<pre class="brush: js">[1,2,3,4,5].map(function factorial (n) {
+ return !(n &gt; 1) ? 1 : factorial(n-1)*n;
+});</pre>
+
+<p>이는 많은 이점이 있습니다:</p>
+
+<ul>
+ <li>함수는 코드 내부에서 다른 함수처럼 호출될 수 있습니다</li>
+ <li>외부 범위(outer scope)에서 변수를 만들지 않습니다 (<a href="http://kangax.github.io/nfe/#example_1_function_expression_identifier_leaks_into_an_enclosing_scope">IE 8 아래는 제외하고</a>)</li>
+ <li>arguments 객체에 액세스하는 것보다 성능이 더 낫습니다</li>
+</ul>
+
+<p>사라지게 됐던 또 다른 기능은 <code>arguments.callee.caller</code> 또는 더 명확하게 <code>Function.caller</code>였습니다. 이는 왜일까요? 자, 어느 시점에서든 당신은 모든 함수의 스택 상 가장 깊은 caller를 찾을 수 있고 위에서 말했듯이 호출 스택 보기는 한 가지 주요 효과가 있습니다: 이는 큰 수의 최적화를 불가능 또는 훨씬 훨씬 더 어렵게 합니다. 예를 들어, 함수 <code>f</code>가 익명(unknown) 함수를 호출하지 않음을 보장할 수 없는 경우, <code>f</code>를 인라인하는 게 가능하지 않습니다. 원래 사소하게 인라인 가능했을 지도 모를 모든 호출 사이트가 다수의 guard를 축적함을 뜻합니다:</p>
+
+<pre class="brush: js">function f (a, b, c, d, e) { return a ? b * c : d * e; }</pre>
+
+<p>JavaScript 인터프리터가 제공된 모든 인수가 호출이 행해진 그 시점에 숫자임을 보장할 수 없다면, 인라인된 코드 앞에 모든 인수에 대한 검사 삽입이 필요합니다. 그렇지 않으면 그 함수를 인라인할 수 없습니다. 이제 이 특정한 경우에 스마트 인터프리터는 더 최적이고 사용되지 않을 값은 확인하지 않을 검사를 재배열할 수 있어야 합니다. 그러나 많은 경우에 그건 그냥 가능하지 않고 그러므로 인라인은 불가능하게 됩니다.</p>
+
+<h2 id="예">예</h2>
+
+<h3 id="익명_재귀_함수에서_arguments.callee_사용하기">익명 재귀 함수에서 <code>arguments.callee</code> 사용하기</h3>
+
+<p>재귀 함수는 자신을 참조할 수 있어야 합니다. 보통, 함수는 그 이름으로 자신을 참조합니다. 그러나, 익명 함수(<a href="/ko/docs/Web/JavaScript/Reference/Operators/function" title="function expression">함수 식</a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function" title="Function constructor"><code>Function</code> 생성자</a>로 생성될 수 있는)는 이름이 없습니다. 그러므로 그를 참조하는 액세스 가능한 변수가 없는 경우, 함수가 자신을 참조할 수 있는 유일한 방법은 <code>arguments.callee</code>에 의해서입니다.</p>
+
+<p>다음 예는 차례로 팩토리얼 함수를 정의하고 반환하는 함수를 정의합니다. 이 예는 매우 실용적이지 않고 같은 결과가 <a href="/ko/docs/Web/JavaScript/Reference/Operators/function" title="named function expressions">유명 함수 식</a>으로 달성될 수 없는 경우가 거의 없습니다.</p>
+
+<pre class="brush: js">function create() {
+ return function(n) {
+ if (n &lt;= 1)
+ return 1;
+ return n * arguments.callee(n - 1);
+ };
+}
+
+var result = create()(5); // 반환값 120 (5 * 4 * 3 * 2 * 1)</pre>
+
+<h3 id="좋은_대안_없는_arguments.callee의_사용">좋은 대안 없는 <code>arguments.callee</code>의 사용</h3>
+
+<p>그러나, 다음과 같은 경우에는 <code>arguments.callee</code>에 대안이 없습니다. 그래서 그 사라짐(deprecation)은 버그가 될 수 있습니다 ({{Bug("725398")}} 참조):</p>
+
+<pre class="brush: js">function createPerson (sIdentity) {
+ var oPerson = new Function("alert(arguments.callee.identity);");
+ oPerson.identity = sIdentity;
+ return oPerson;
+}
+
+var john = createPerson("John Smith");
+
+john();</pre>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">스펙</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>초기 정의. JavaScript 1.2에서 구현됨</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li>{{jsxref("Function")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/arguments/caller/index.html b/files/ko/web/javascript/reference/functions/arguments/caller/index.html
new file mode 100644
index 0000000000..bcdc54c7dc
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/arguments/caller/index.html
@@ -0,0 +1,93 @@
+---
+title: arguments.caller
+slug: Web/JavaScript/Reference/Functions/arguments/caller
+translation_of: Archive/Web/JavaScript/arguments.caller
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p>이전의 <strong><code>arguments.caller</code></strong> 속성은 현재 실행한 함수를 적용하여 제공했었습니다. 이 속성은 삭제되었으며 더 이상 작동하지 않습니다.</p>
+
+<h2 id="설명">설명</h2>
+
+<p>이 속성은 더 이상 이용할 수 없습니다. 하지만 {{jsxref("Function.caller")}} 는 사용할 수 있습니다.</p>
+
+<pre class="brush: js">function whoCalled() {
+ if (whoCalled.caller == null)
+ console.log('I was called from the global scope.');
+ else
+ console.log(whoCalled.caller + ' called me!');
+}</pre>
+
+<h2 id="예">예</h2>
+
+<p>다음의 코드는 함수 내에서 <code>arguments.caller </code>값을 확인하기 위해 사용되었지만, 더 이상 작동하지 않습니다.</p>
+
+<pre class="brush: js example-bad">function whoCalled() {
+ if (arguments.caller == null)
+ console.log('I was called from the global scope.');
+ else
+ console.log(arguments.caller + ' called me!');
+}
+</pre>
+
+<h2 id="스펙">스펙</h2>
+
+<p>초기 정의된 부분이 아닙니다. JavaScript 1.1에서 구현되었으며, 잠재적인 보안 취약의 우려로 ({{bug(7224)}}) 삭제되었습니다.</p>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li>{{jsxref("Function")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/arguments/index.html b/files/ko/web/javascript/reference/functions/arguments/index.html
new file mode 100644
index 0000000000..98b5f1385b
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/arguments/index.html
@@ -0,0 +1,189 @@
+---
+title: arguments 객체
+slug: Web/JavaScript/Reference/Functions/arguments
+tags:
+ - Functions
+ - JavaScript
+ - Reference
+translation_of: Web/JavaScript/Reference/Functions/arguments
+---
+<div>
+<div>{{jsSidebar("Functions")}}</div>
+</div>
+
+<p><strong><code>arguments</code></strong> 객체는 함수에 전달된 인수에 해당하는 <code>Array</code> 형태의 객체입니다.</p>
+
+<div class="blockIndicator note">
+<p><strong>Note:</strong> ES6 호환 코드를 작성 중이라면 되도록 <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters">나머지 매개변수</a> 구문을 사용해야 합니다.</p>
+</div>
+
+<div class="blockIndicator note">
+<p><strong>참고</strong>: "<code>Array</code> 형태"란 <code>arguments</code>가 {{jsxref("Array.length", "length")}} 속성과 더불어 0부터 인덱스 된 다른 속성을 가지고 있지만, {{jsxref("Array")}}의 {{jsxref("Array.prototype.forEach()", "forEach")}}, {{jsxref("Array.prototype.map()", "map")}}과 같은 내장 메서드를 가지고 있지 않다는 뜻입니다.</p>
+</div>
+
+<div>{{EmbedInteractiveExample("pages/js/functions-arguments.html")}}</div>
+
+
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">arguments</pre>
+
+<h2 id="설명">설명</h2>
+
+<p><code>arguments</code> 객체는 모든 함수 내에서 이용 가능한 지역 변수입니다. <code>arguments</code> 객체를 사용하여 함수 내에서 모든 인수를 참조할 수 있으며, 호출할 때 제공한 인수 각각에 대한 항목을 갖고 있습니다. 항목의 인덱스는 0부터 시작합니다.</p>
+
+<p>예를 들어, 함수가 세 개의 인수를 받은 경우 다음과 같이 접근할 수 있습니다.</p>
+
+<pre class="brush: js">arguments[0]
+arguments[1]
+arguments[2]
+</pre>
+
+<p>각 인수를 설정하거나 재할당할 수도 있습니다.</p>
+
+<pre class="brush: js">arguments[1] = 'new value';
+</pre>
+
+<p><code>arguments</code> 객체는 {{jsxref("Array")}}가 아닙니다. <code>Array</code>와 비슷하지만, {{jsxref("Array.prototype.length", "length")}} 빼고는 {{jsxref("Array.prototype.pop", "pop()")}}과 같은 어떤 <code>Array</code> 속성도 없습니다. 그러나 실제 <code>Array</code>로 변환할 수 있습니다:</p>
+
+<pre class="brush: js">var args = Array.prototype.slice.call(arguments);
+var args = [].slice.call(arguments);
+</pre>
+
+<p><code>arguments</code>를 실제 <code>Array</code>로 변환하기 위해 ES2015의 {{jsxref("Array.from()")}} 메서드 또는 <a href="/ko/docs/Web/JavaScript/Reference/Operators/Spread_operator" title="spread operator">전개 연산자</a>를 사용할 수도 있습니다.</p>
+
+<pre class="brush: js">var args = Array.from(arguments);
+var args = [...arguments];
+</pre>
+
+<p>당신이 형식상 받기로 선언된 것보다 많은 인수로 함수를 호출하는 경우 <code>arguments</code> 객체를 사용할 수 있습니다. 이 기법은 가변 인수가 전달될 수 있는 함수에 유용합니다. 함수에 전달된 인수의 수를 결정하기 위해 <code><a href="/ko/docs/JavaScript/Reference/Functions_and_function_scope/arguments/length">arguments.length</a></code>를 쓰세요, 그 뒤에 <code>arguments</code> 객체를 사용하여 각 인수를 처리하세요. 함수 <a href="/ko/docs/Glossary/Signature/Function">signature</a>에 매개변수의 수를 결정하기 위해서는, <code><a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function/length">Function.length</a></code> 속성을 쓰세요.</p>
+
+<h2 id="속성">속성</h2>
+
+<dl>
+ <dt><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/callee">arguments.callee</a></code></dt>
+ <dd>현재 실행 중인 함수를 가리킵니다.</dd>
+ <dt><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/caller">arguments.caller</a></code> {{ Obsolete_inline() }}</dt>
+ <dd>현재 실행 중인 함수를 호출한 함수를 가리킵니다.</dd>
+ <dt><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/length">arguments.length</a></code></dt>
+ <dd>함수에 전달된 인수의 수를 가리킵니다.</dd>
+ <dt><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/@@iterator">arguments[@@iterator]</a></code></dt>
+ <dd>arguments의 각 인덱스 값을 포함하는 새로운 Array Iterator 객체를 반환합니다.</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="여러_문자열을_연결하는_함수_정의하기">여러 문자열을 연결하는 함수 정의하기</h3>
+
+<p>이 예는 여러 문자열을 연결하는 함수를 정의합니다. 함수의 유일한 형식 인수는 연결할 항목을 구분하는 문자를 지정하는 문자열입니다. 함수는 다음과 같이 정의됩니다:</p>
+
+<pre class="brush:js">function myConcat(separator) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return args.join(separator);
+}</pre>
+
+<p>이 함수에 인수를 얼마든지 전달할 수 있으며 리스트 내 항목처럼 각 인수를 사용하여 리스트를 만듭니다.</p>
+
+<pre class="brush:js">// "red, orange, blue" 반환
+myConcat(", ", "red", "orange", "blue");
+
+// "elephant; giraffe; lion; cheetah" 반환
+myConcat("; ", "elephant", "giraffe", "lion", "cheetah");
+
+// "sage. basil. oregano. pepper. parsley" 반환
+myConcat(". ", "sage", "basil", "oregano", "pepper", "parsley");</pre>
+
+<h3 id="HTML_리스트를_만드는_함수_정의하기">HTML 리스트를 만드는 함수 정의하기</h3>
+
+<p>이 예는 리스트 HTML을 포함하는 문자열을 만드는 함수를 정의합니다. 함수의 유일한 형식 인수는 리스트가 정렬되지 않은(bulluet(글 머리 기호)가 붙는) 경우 "<code>u</code>" 또는 정렬된(번호가 매겨진) 경우 "<code>o</code>"인 문자열입니다. 함수는 다음과 같이 정의됩니다:</p>
+
+<pre class="brush:js">function list(type) {
+ var result = "&lt;" + type + "l&gt;&lt;li&gt;";
+ var args = Array.prototype.slice.call(arguments, 1);
+ result += args.join("&lt;/li&gt;&lt;li&gt;");
+ result += "&lt;/li&gt;&lt;/" + type + "l&gt;"; // end list
+
+ return result;
+}</pre>
+
+<p>이 함수에 인수를 얼마든지 전달할 수 있고, 표시된 유형의 리스트에 항목으로 각 인수를 추가합니다. 예를 들면:</p>
+
+<pre class="brush:js">var listHTML = list("u", "One", "Two", "Three");
+
+/* listHTML은:
+
+"&lt;ul&gt;&lt;li&gt;One&lt;/li&gt;&lt;li&gt;Two&lt;/li&gt;&lt;li&gt;Three&lt;/li&gt;&lt;/ul&gt;"
+
+*/</pre>
+
+<h3 id="나머지_기본_및_비구조화된_매개변수">나머지, 기본 및 비구조화된 매개변수</h3>
+
+<p><code>arguments</code> 객체는 <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="rest parameters">나머지 매개변수</a>, <a href="/ko/docs/Web/JavaScript/Reference/Functions/Default_parameters" title="default parameters">기본 매개변수</a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" title="destructured parameters">비구조화된 매개변수</a>와 함께 사용될 수 있습니다.</p>
+
+<pre class="brush: js">function foo(...args) {
+ return arguments;
+}
+foo(1, 2, 3); // { "0": 1, "1": 2, "2": 3 }
+</pre>
+
+<p>그러나, 비엄격 함수에서는 <strong>mapped <code>arguments</code> 객체</strong>는 함수가 어떤 <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="rest parameters">나머지 매개변수</a>, <a href="/ko/docs/Web/JavaScript/Reference/Functions/Default_parameters" title="default parameters">기본 매개변수</a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" title="destructured parameters">비구조화된 매개변수</a>든 포함하지 <strong>않는</strong> 경우에만 제공됩니다. 예를 들어, 기본 매개변수를 사용하는 다음 함수에서는, 100 대신에 <code>10</code>이 반환됩니다:</p>
+
+<pre class="brush: js">function bar(a=1) {
+ arguments[0] = 100;
+ return a;
+}
+bar(10); // 10
+</pre>
+
+<p>이 예에서, 어떤 <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="rest parameters">나머지 매개변수</a>, <a href="/ko/docs/Web/JavaScript/Reference/Functions/Default_parameters" title="default parameters">기본 매개변수</a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" title="destructured parameters">비구조화된 매개변수</a>가 없는 경우에는, 100이 반환됩니다:</p>
+
+<pre class="brush: js">function zoo(a) {
+ arguments[0] = 100;
+ return a;
+}
+zoo(10); // 100
+
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">스펙</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>초기 정의. JavaScript 1.1에서 구현됨</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.functions.arguments")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Function")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/arguments/length/index.html b/files/ko/web/javascript/reference/functions/arguments/length/index.html
new file mode 100644
index 0000000000..d8ea3f0da4
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/arguments/length/index.html
@@ -0,0 +1,74 @@
+---
+title: arguments.length
+slug: Web/JavaScript/Reference/Functions/arguments/length
+translation_of: Web/JavaScript/Reference/Functions/arguments/length
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><strong><code>arguments.length</code></strong> 속성은 함수에 전달된 인수의 수를 포함하고 있습니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">arguments.length</pre>
+
+<h2 id="설명">설명</h2>
+
+<p>arguments.length 속성은 실제로 함수에 전달된 arguments 의 수를 제공합니다. 이것은 정의된 매개변수의 수보다 작을 수도 클 수도 있습니다. ({{jsxref("Function.length")}} 보기).</p>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="arguments.length_사용하기"><code>arguments.length</code> 사용하기</h3>
+
+<p>이 예시에서는 둘 또는 그 이상의 수를 더할 수 있는 함수를 정의합니다.</p>
+
+<pre class="brush: js">function adder(base /*, n2, ... */) {
+ base = Number(base);
+ for (var i = 1; i &lt; arguments.length; i++) {
+ base += Number(arguments[i]);
+ }
+ return base;
+}
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>초기 정의. JavaScript 1.1에서 구현됨.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-10.6', 'Arguments Object')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-arguments-exotic-objects', 'Arguments Exotic Objects')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.functions.arguments.length")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Function")}}</li>
+ <li>{{jsxref("Function.length")}}</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/default_parameters/index.html b/files/ko/web/javascript/reference/functions/default_parameters/index.html
new file mode 100644
index 0000000000..2783b65844
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/default_parameters/index.html
@@ -0,0 +1,239 @@
+---
+title: 기본값 매개변수
+slug: Web/JavaScript/Reference/Functions/Default_parameters
+tags:
+ - ECMAScript2015
+ - ECMAScript6
+ - Functions
+ - JavaScript
+ - 기본값 매개변수
+translation_of: Web/JavaScript/Reference/Functions/Default_parameters
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p> 기본값 함수 매개변수 (<strong>default function parameter</strong>)를 사용하면 값이 없거나 <code>undefined</code>가 전달될 경우 이름붙은 매개변수를 기본값으로 초기화할 수 있습니다.</p>
+
+<p>{{EmbedInteractiveExample("pages/js/functions-default.html")}}</p>
+
+<div class="hidden">
+<p>위의 상호작용가능한 예제의 소스는 깃허브 저장소에 저장됩니다. 상호작용 예제 프로젝트에 기여하고 싶다면 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> 를 클론(clone)하여 풀 리퀘스트(pull request) 를 보내주세요.</p>
+</div>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox notranslate">function [<em>name</em>]([<em>param1</em>[ = <em>defaultValue1</em> ][, ..., <em>paramN</em>[ = defaultValueN ]]]) {
+ <em>statements</em>
+}
+</pre>
+
+<h2 id="설명">설명</h2>
+
+<p>JavaScript에서, 함수의 매개변수는 <code>{{jsxref("undefined")}}</code>가 기본입니다. 그러나, 일부 상황에서는 다른 기본 값을 설정하는 것이 유용할 수 있습니다. 이때가 바로 기본값 매개변수 가 필요할 때 입니다.</p>
+
+<p>과거에 기본값 설정을 위한 일반적인 방법은 함수 내부(body)에서 매개변수 값을 검사해 <code>undefined</code>인 경우 값을 할당하는 것이었습니다.</p>
+
+<p>다음 예제에서, <code>multiply</code>호출시 <code>b</code>에 할당된  값이 없다면, <code>b</code> 값은 <code>a*b</code>를 평가할 때 <code>undefined</code>일 거고 <code>multiply</code> 호출은 <code>NaN</code>이 반환됩니다. </p>
+
+<pre class="notranslate"><code>function multiply(a, b) {
+ return a * b
+}
+
+multiply(5, 2) // 10
+multiply(5) // NaN !</code></pre>
+
+<p>이를 방지하기 위해서, 아래 두번째 줄과 같이  <code>multiply</code> 함수가 오직 한 개의 인수만 있다면  <code>b</code>를  <code>1</code>로 설정하는 방식을 사용하곤 했습니다.</p>
+
+<pre class="brush: js notranslate">function multiply(a, b) {
+ b = (typeof b !== 'undefined') ? b : 1
+ return a*b
+}
+
+multiply(5, 2) // 10
+multiply(5) // 5
+</pre>
+
+<p>ES2015의 기본값 매개변수로 함수 내부 에서의 검사는 더 이상 필요치 않습니다. 이제, 간단히 함수 머리(head)에서 <code>b</code>의 기본값으로 <code>1</code> 로 설정할 수 있습니다:</p>
+
+<pre class="brush: js notranslate">function multiply(a, b = 1) {
+ return a*b
+}
+
+multiply(5, 2) // 10
+multiply(5) // 5
+multiply(5, undefined) // 5
+</pre>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="undefined_vs._다른_거짓같은_값falsy_values_전달하기"><code>undefined</code> vs. 다른 거짓같은 값(falsy values) 전달하기</h3>
+
+<p>아래 예제중 두 번째 호출에서, 설사 두 번째 인수를 호출할 때 명시해서 <code>undefined</code> (<code>null</code> 혹은 {{glossary("falsy")}} 값이 아니긴 하지만 )로 설정하더라도 , <code>num</code> 인수의 값은 여전히 기본값입니다.</p>
+
+<pre class="brush: js notranslate">function test(num = 1) {
+  console.log(typeof num)
+}
+
+test() // 'number' (num 은 1로 설정됨)
+test(undefined) // 'number' (num 이 역시 1로 설정됨)
+
+// 다른 falsy values로 테스트 하기:
+test('') // 'string' (num 은 ''로 설정됨)
+test(null) // 'object' (num 은 null로 설정됨)
+</pre>
+
+<h3 id="호출_시_평가">호출 시 평가</h3>
+
+<p>기본 인수는 <em>호출</em> <em>시 </em>에 평가됩니다, 그래서 Python의 경우 와는 달리, 함수가 호출될 때마다 새로운 객체가 생성됩니다.</p>
+
+<pre class="brush: js notranslate">function append(value, array = []) {
+ array.push(value)
+ return array
+}
+
+append(1) // [1]
+append(2) // [2], [1, 2]가 아니라
+
+</pre>
+
+<p>이는 심지어 함수 및 변수에도 적용됩니다:</p>
+
+<pre class="brush: js notranslate">function callSomething(thing = something()) {
+  return thing
+}
+
+let numberOfTimesCalled = 0
+function something(){
+  numberOfTimesCalled += 1
+ return numberOfTimesCalled
+}
+
+callSomething() // 1
+callSomething() // 2
+</pre>
+
+<h3 id="앞쪽_매개변수는_뒷쪽의_매개변수_기본값에_사용할_수_있습니다">앞쪽 매개변수는 뒷쪽의 매개변수 기본값에 사용할 수 있습니다</h3>
+
+<p>매개 변수가 여러개일 때 앞쪽에( 왼쪽 부분) 정의된 매개변수는 뒷쪽에 정의된 매개변수의 기본값에  바로 사용할 수 있습니다.</p>
+
+<pre class="brush: js notranslate">function greet(name, greeting, message = greeting + ' ' + name) {
+  return [name, greeting, message]
+}
+
+greet('David', 'Hi') // ["David", "Hi", "HiDavid"]
+greet('David', 'Hi', 'Happy Birthday!') // ["David", "Hi", "Happy Birthday!"]
+</pre>
+
+<p>이 기능은,  얼마나 많은 경계 조건(edge case)를 다룰수 있는지 보여주는, 아래 예제로 거의 설명 가능합니다.</p>
+
+<pre class="brush: js notranslate">function go() {
+ return ':P'
+}
+
+// 함수 정의가 간단해짐
+function withDefaults(a, b = 5, c = b, d = go(), e = this,
+ f = arguments, g = this.value) {
+ return [a,b,c,d,e,f,g]
+}
+
+// 함수 정의가 길고 장황함
+function withoutDefaults(a, b, c, d, e, f, g){
+ switch(arguments.length){
+ case 0:
+ a;
+ case 1:
+ b = 5;
+ case 2:
+ c = b;
+ case 3:
+ d = go();
+ case 4:
+ e = this;
+ case 5:
+ f = arguments;
+ case 6:
+ g = this.value;
+ default:
+ }
+ return [a,b,c,d,e,f,g];
+}
+
+// 아래와 같이 함수 호출하면 동일한 결과를 보임
+
+withDefaults.call({value:"=^_^="});
+// [undefined, 5, 5, ":P", {value:"=^_^="}, arguments, "=^_^="]
+
+withoutDefaults.call({value:"=^_^="});
+// [undefined, 5, 5, ":P", {value:"=^_^="}, arguments, "=^_^="]
+</pre>
+
+<h3 id="유효범위_효과_Scope_Effects">유효범위 효과 (Scope Effects)</h3>
+
+<p>한개 이상의 매개변수에 기본값이 지정되면 특별히 매개변수 목록내의 식별자들(identifiers) 대상으로, <a href="https://tc39.es/ecma262/#sec-functiondeclarationinstantiation">두번째 스코프</a> (Environment Record) 가 생성됩니다.</p>
+
+<p>이 말은 함수 내부에 선언된 함수와 변수들은 매개변수 기본값 초기화시에 참조할 수  없다는 말입니다; 그렇게 하려고 하면 실행시간 에러인 {{jsxref("ReferenceError")}} 를 유발합니다.</p>
+
+<p>이 말은 또한 함수 내부에서 <code>var</code> 로 선언된 변수는 동일한 이름을 가진 매개변수를 가리게 되는, 중첩 <code>var</code> 선언 으로 인한 일반적인 동작이 일어나지 않는다는 말입니다.</p>
+
+<p>아래 함수는 호출되면 <code>ReferenceError</code> 를 발생시킵니다. 매개변수 기본값이 함수 내부의 자식 유효범위를 참조할 수 없기 때문입니다.</p>
+
+<pre class="brush: js example-bad notranslate">function f(a = go()) { // `f`가 호출 되면 `ReferenceError` 발생
+ function go() { return ':P' }
+}</pre>
+
+<p>...그리고 아래 함수는 <code>undefined</code> 를 프린트 하는데,  <code>var a</code> 가 함수 내부 대상의 유효범위내에서만 효과를 가지기 때문입니다. ( 매개변수 목록이 대상인 부모 스코프가 아니라)</p>
+
+<pre class="brush: js example-bad notranslate">function f(a, b = () =&gt; console.log(a)) {
+ var a = 1
+ b() // `undefined`를 인쇄하는데, 매개변수 기본값이 자체 스코프에 있기 때문입니다
+} </pre>
+
+<h3 id="기본값_매개변수_뒤쪽의_기본값_없는_매개변수">기본값 매개변수 뒤쪽의 기본값 없는 매개변수</h3>
+
+<p>매개변수는 여전히 왼쪽에서 오른쪽으로 설정됩니다. 아래 예제에서 뒷쪽에 기본값이 없는 매개변수가 있지만 기본값 매개변수를 덮어씁니다.</p>
+
+<pre class="brush: js notranslate">function f(x=1, y) {
+ return [x, y];
+}
+
+f() // [1, undefined]
+f(2) // [2, undefined]
+</pre>
+
+<h3 id="기본값_할당_있는_해체된_매개변수">기본값 할당 있는 해체된 매개변수</h3>
+
+<p>기본값 할당을 {{jsxref("Operators/Destructuring_assignment", "destructuring assignment", "", 1)}} 표기와 함께 사용할 수 있습니다:</p>
+
+<pre class="brush: js notranslate">function f([x, y] = [1, 2], {z: z} = {z: 3}) {
+ return x + y + z
+}
+
+f() // 6</pre>
+
+<h2 id="스펙">스펙</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-function-definitions', 'Function Definitions')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div class="hidden">
+<p>이 페이지의 호환성 표는 구조화된 데이타로 부터 생성됩니다. 해당 데이타 업데이트에 기여하고 싶다면 이 깃허브 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> 를 체크아웃 해서 풀 리퀘스트를 보내주세요.</p>
+</div>
+
+<p>{{Compat("javascript.functions.default_parameters")}}</p>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li><a class="external" href="http://wiki.ecmascript.org/doku.php?id=harmony:parameter_default_values" rel="external" title="http://wiki.ecmascript.org/doku.php?id=harmony:parameter_default_values">Original proposal at ecmascript.org</a></li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/get/index.html b/files/ko/web/javascript/reference/functions/get/index.html
new file mode 100644
index 0000000000..fb64206dff
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/get/index.html
@@ -0,0 +1,179 @@
+---
+title: getter
+slug: Web/JavaScript/Reference/Functions/get
+tags:
+ - 자바스크립트
+ - 함수
+translation_of: Web/JavaScript/Reference/Functions/get
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><strong><code>get</code></strong> 구문은 객체의 프로퍼티를 그 프로퍼티를 가져올 때 호출되는 함수로 바인딩합니다.</p>
+
+<p>{{EmbedInteractiveExample("pages/js/functions-getter.html")}}</p>
+
+
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">{get <em>prop</em>() { ... } } {get <em>[expression]</em>() { ... } }</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>prop</code></dt>
+ <dd>주어진 함수를 바인딩할 프로퍼티의 이름입니다.</dd>
+ <dt>expression</dt>
+ <dd>ECMAScript 2015가 도입되면서, 함수의 이름을 계산하기 위해 표현식을 사용할 수 있습니다.</dd>
+</dl>
+
+<h2 id="설명">설명</h2>
+
+<p>어떤 프로퍼티에 접근할 때마다 그 값을 계산하도록 해야 하거나, 내부 변수의 상태를 명시적인 함수 호출 없이 보여주고 싶을 때, JavaScript의 <em>getter</em>를 이용할 수 있습니다. getter가 바인딩된 프로퍼티는 동시에 실제 값을 가질 수는 없지만, getter와 setter를 동시에 바인딩해 일종의 유사 프로퍼티(pseudo-property)를 만들 수는 있습니다.</p>
+
+<p><code>get</code> 구문을 이용할 때는 다음을 유의하세요.</p>
+
+<div>
+<ul>
+ <li>숫자나 문자열로 구성된 식별자를 이용할 수 있습니다.</li>
+ <li>getter는 절대로 매개변수를 가져서는 안 됩니다. (<a class="external" href="http://whereswalden.com/2010/08/22/incompatible-es5-change-literal-getter-and-setter-functions-must-now-have-exactly-zero-or-one-arguments/" rel="external nofollow">Incompatible <abbr title="ECMAScript 5th edition">ES5</abbr> change: literal getter and setter functions must now have exactly zero or one arguments</a> 를 참조하세요.)</li>
+ <li>하나의 객체 리터럴에 또다른 getter나 데이터 바인딩은 불가능합니다. (<code>{ get x() { }, get x() { } }</code> 나 <code>{ x: ..., get x() { } }</code> 는 사용할 수 없습니다.)</li>
+</ul>
+</div>
+
+<p>getter는 <code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete" title="en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/delete_Operator">delete</a></code> 연산자를 이용해 삭제할 수 있습니다.</p>
+
+<h2 id="예">예</h2>
+
+<h3 id="getter를_객체_초기자에서_정의하기">getter를 객체 초기자에서 정의하기</h3>
+
+<p>객체 <code>obj</code>에 유사 프로퍼티 <code>latest</code>를 생성합니다. <code>latest</code>는 배열 <code>log</code>의 마지막 요소를 반환합니다.</p>
+
+<pre><code>var obj = {
+ log: ['example','test'],
+ get latest() {
+ if (this.log.length == 0) return undefined;
+ return this.log[this.log.length - 1];
+ }
+}
+console.log(obj.latest); // "test".</code></pre>
+
+<p><code>latest</code>에 어떤 값을 할당하려고 시도해도 그 값이 바뀌지 않는다는 점을 유의하세요.</p>
+
+<h3 id="delete연산자를_이용해_getter_삭제하기"><code>delete</code>연산자를 이용해 getter 삭제하기</h3>
+
+<p>getter를 삭제하고 싶다면, <code><a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete">delete</a></code>를 이용하면 됩니다.</p>
+
+<pre class="brush: js">delete obj.latest;
+</pre>
+
+<h3 id="defineProperty를_이용해_이미_존재하는_객체에_getter_정의하기"><code>defineProperty</code>를 이용해 이미 존재하는 객체에 getter 정의하기</h3>
+
+<p>이미 존재하는 객체에 getter를 추가하고자 한다면, {{jsxref("Object.defineProperty()")}}를 이용하면 됩니다.</p>
+
+<pre class="brush: js">var o = { a:0 }
+
+Object.defineProperty(o, "b", { get: function () { return this.a + 1; } });
+
+console.log(o.b) // getter를 실행합니다. a + 1 (= 1)이 반환됩니다.</pre>
+
+<h3 id="계산된_(computed)_프로퍼티_이름">계산된 (computed) 프로퍼티 이름</h3>
+
+<pre class="brush: js">var expr = "foo";
+
+var obj = {
+ get [expr]() { return "bar"; }
+};
+
+console.log(obj.foo); // "bar"</pre>
+
+<h3 id="똑똑한(Smart)_스스로_덮어쓰는(self-overwriting)_느긋한(lazy)_getter">똑똑한(Smart) / 스스로 덮어쓰는(self-overwriting) / 느긋한(lazy) getter</h3>
+
+<p>Getter는 객체에 프로퍼티를 정의할 수 있도록 하지만, 그 프로퍼티에 접근하기 전까지는 값을 계산하지 않습니다. getter는 값을 계산하는 비용을 실제 값이 필요할 때까지 미루며, 그 값이 필요없다면 계산 비용도 들지 않습니다.</p>
+
+<p>또다른 최적화 기법으로는 계산 미루기와 함께 프로퍼티 값을 나중에 접근하기 위해 캐싱하는 것이 있습니다. 이를<strong> 똑똑한(smart), 혹은 메모화된(<a href="https://en.wikipedia.org/wiki/Memoization">memoized</a>) getter</strong>라고 부릅니다. 값은 getter가 호출될 때 처음 계산되며, 캐싱됩니다. 이후의 호출에는 다시 계산하지 않고 이 캐시값을 반환합니다. 이는 다음과 같은 상황에 유용합니다.</p>
+
+<ul>
+ <li>값의 계산 비용이 큰 경우. (RAM이나 CPU 시간을 많이 소모하거나, worker thread를 생성하거나, 원격 파일을 불러오는 등)</li>
+ <li>값이 당장은 필요하지 않지만 나중에 사용되어야 할 경우, 혹은 절대로 이용되지 않을 수도 있는 경우.</li>
+ <li>값이 여러 차례 이용되지만 절대 변경되지 않아 매번 다시 계산할 필요가 없는 경우, 혹은 다시 계산되어서는 안 되는 경우.</li>
+</ul>
+
+<p>똑똑한 getter는 값을 다시 계산하지 않기 때문에, 값의 변경이 예상되는 경우에는 똑똑한 getter를 이용해서는 안 됩니다.</p>
+
+<p>다음 예제에서, 객체는 원래 프로퍼티로 getter를 가집니다. 프로퍼티를 가져올 때, getter는 삭제되며 대신 명시적인 값이 저장됩니다. 최종적으로 값을 반환합니다.</p>
+
+<pre class="brush: js">get notifier() {
+ delete this.notifier;
+ return this.notifier = document.getElementById("bookmarked-notification-anchor");
+},</pre>
+
+<p>Firefox 코드의 경우,  <code><a href="/en-US/docs/Mozilla/JavaScript_code_modules/XPCOMUtils.jsm#defineLazyGetter()">defineLazyGetter()</a></code> 함수를 정의하고 있는 XPCOMUtils.jsm 모듈을 참조하세요.</p>
+
+<h3 id="get_Vs._defineProperty"><code>get</code> Vs. <code>defineProperty</code></h3>
+
+<p>While using the <code>get</code> 키워드와 {{jsxref("Object.defineProperty()")}}를 사용하면 비슷한 결과를 얻지만, {{jsxref("classes")}}에서 사용되는 두 가지 경우에는 미묘한 차이가 있습니다.</p>
+
+<p>get을 사용할 때 속성은 {{jsxref("Object.defineProperty()")}} 를 사용하는 동안 객체의 프로토 타입에 정의 될 것이고, 속성은 그것이 적용되는 인스턴스에 정의 될 것입니다.</p>
+
+<pre class="brush: js"><code>class Example {
+ get hello() {
+ return 'world';
+ }
+}
+
+const obj = new Example();
+console.log(obj.hello);
+// "world"
+console.log(Object.getOwnPropertyDescriptor(obj, 'hello'));
+// undefined
+console.log(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), 'hello'));
+// { configurable: true, enumerable: false, get: function get hello() { return 'world'; }, set: undefined }</code></pre>
+
+<p> </p>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">스펙</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-11.1.5', 'Object Initializer')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>최초로 정의되었습니다.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>계산된 프로퍼티 이름이 추가되었습니다.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("javascript.functions.get")}}</p>
+
+<p> </p>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions/set">setter</a></li>
+ <li>{{jsxref("Operators/delete", "delete")}}</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Object.defineGetter", "__defineGetter__")}}</li>
+ <li>{{jsxref("Object.defineSetter", "__defineSetter__")}}</li>
+ <li><a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">Defining Getters and Setters</a> in JavaScript Guide</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/index.html b/files/ko/web/javascript/reference/functions/index.html
new file mode 100644
index 0000000000..2052b67a93
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/index.html
@@ -0,0 +1,596 @@
+---
+title: 함수
+slug: Web/JavaScript/Reference/Functions
+tags:
+ - 생성자
+ - 인자
+ - 파라미터
+ - 함수
+translation_of: Web/JavaScript/Reference/Functions
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p>일반적으로, 함수는 함수 외부 (또는 재귀(recursion)의 경우엔 내부) 코드에 의해 <em>호출될</em> 수 있는 "하위프로그램"입니다. 프로그램 그 자체처럼, 함수는 함수 몸통(<em>function body</em>)이라고 하는 일련의 구문(statement)으로 구성됩니다. 값은 함수에 <em>전달될</em> 수 있고 함수는 값을 <em>반환</em>합니다.</p>
+
+<p>JavaScript에서, 함수는 다른 객체처럼 속성 및 메서드를 가질 수 있기에 일급(first-class) 객체입니다. 다른 객체와 함수를 구별하는 것은 함수는 호출될 수 있다는 것입니다. 간단히 말해, 함수는 <code><a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a></code> 객체입니다.</p>
+
+<p>더 많은 예제와 설명은, <a href="/ko/docs/Web/JavaScript/Guide/함수" title="JavaScript guide about functions">JavaScript 함수 안내서</a>를 참조하세요.</p>
+
+<h2 id="설명">설명</h2>
+
+<p>JavaScript에서 모든 함수는 <code>Function</code> 객체입니다. <code>Function</code> 객체의 속성(property) 및 메서드에 관한 정보는 {{jsxref("Function")}} 참조.</p>
+
+<p>기본값 이외의 값을 반환하려면, 함수는 반환할 값을 지정하는 <code><a href="/ko/docs/Web/JavaScript/Reference/Statements/return">return</a></code> 문이 있어야 합니다. return 문이 없는 함수는 기본값을 반환합니다. <code><a href="/ko/docs/Web/JavaScript/Reference/Operators/new">new</a></code> 키워드로 호출되는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor">생성자</a>의 경우에, 기본값은 자신의 <code>this</code> 매개변수 값입니다. 다른 모든 함수의 경우, 기본 반환값은 {{jsxref("undefined")}}입니다.</p>
+
+<p>함수 호출의 매개변수는 함수의 <em>인수</em>입니다. 인수는 함수에 <em>값으로</em> 전달됩니다. 함수가 인수값을 바꾸면, 이 변화는 전역 또는 호출한 함수에 반영되지 않습니다. 그러나, 객체 참조(reference)는 값이지만 특별합니다: 함수가 참조된 객체의 속성을 바꾸면, 그 변화는 다음 예에서와 같이 함수 밖에서도 바뀌는 것을 볼 수 있습니다:</p>
+
+<pre class="brush: js">/* 함수 'myFunc' 선언 */
+function myFunc(theObject) {
+ theObject.brand = "Toyota";
+ }
+
+ /*
+ * 변수 'mycar' 선언;
+ * 새 객체를 만들고 초기화;
+ * 'mycar'에 객체 참조를 할당
+ */
+ var mycar = {
+ brand: "Honda",
+ model: "Accord",
+ year: 1998
+ };
+
+ /* Logs 'Honda' */
+ console.log(mycar.brand);
+
+ /* 객체 참조를 함수에 전달 */
+ myFunc(mycar);
+
+ /*
+ * 함수에 의해 바뀌었기에 객체의
+ * 'brand' 속성의 값으로 'Toyota' 출력.
+ */
+ console.log(mycar.brand);
+</pre>
+
+<p><a href="/ko/docs/Web/JavaScript/Reference/Operators/this"><code>this</code> 키워드</a>는 현재 실행 중인 함수를 참조하지 않습니다, 그래서 심지어 함수 몸통 내에서도 이름으로 <code>Function</code> 객체를 참조해야 합니다.</p>
+
+<h2 id="함수_정의하기">함수 정의하기</h2>
+
+<p>함수를 정의하는 여러 방법이 있습니다:</p>
+
+<h3 id="함수_선언_function_문">함수 선언 (<code>function</code> 문)</h3>
+
+<p>함수 선언을 위한 특별한 구문이 있습니다 (자세한 사항은 <a href="/ko/docs/Web/JavaScript/Reference/Statements/function" title="function statement">function 문</a> 참조):</p>
+
+<pre class="brush: js">function <em>name</em>([<em>param</em>[, <em>param</em>[, ... <em>param</em>]]]) {
+ <em>statements</em>
+}
+</pre>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd>함수 이름.</dd>
+</dl>
+
+<dl>
+ <dt><code>param</code></dt>
+ <dd>함수에 전달되는 인수의 이름. 함수는 255개까지 인수를 가질 수 있습니다.</dd>
+</dl>
+
+<dl>
+ <dt><code>statements</code></dt>
+ <dd>함수의 몸통을 구성하는 문.</dd>
+</dl>
+
+<h3 id="함수_표현식_function_식">함수 표현식 (<code>function</code> 식)</h3>
+
+<p>함수 식(expression)은 함수 선언과 비슷하고 구문이 같습니다 (자세한 사항은 <a href="/ko/docs/Web/JavaScript/Reference/Operators/function" title="function expression">function 식</a> 참조):</p>
+
+<p>함수 표현식(expression)은 함수 선언과 비슷하고 구문이 같습니다 (자세한 내용은 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function">function expression</a> 참조). 함수 표현식은 더 큰 표현식의 일부일 수 있습니다. "이름이 붙은(named)"함수 표현식 (예 : 호출 스택에서 표현식 이름 사용하는경우) 또는 "익명"함수 표현식을 정의 할 수 있습니다. 함수 표현식은 선언이 되지 않은 상태에서 사용할 수 없기 때문에 함수를 사용하기 전에 코드에 함수코드가 존제해야 사용 할 수 있습니다.</p>
+
+<pre class="brush: js">function [<em>name</em>]([<em>param</em>[, <em>param</em>[, ... <em>param</em>]]]) {
+ <em>statements</em>
+}
+</pre>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd>함수 이름. 함수가 익명(anonymous) 함수로 알려진 경우, 생략될 수 있음.</dd>
+</dl>
+
+<dl>
+ <dt><code>param</code></dt>
+ <dd>함수에 전달되는 인수의 이름. 함수는 255개까지 인수를 가질 수 있습니다.</dd>
+ <dt><code>statements</code></dt>
+ <dd>함수의 몸통을 구성하는 문.</dd>
+</dl>
+
+<p>다음은 익명 함수 표현식의 예입니다 (<font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);">이름</span></font> 이 사용되지 않음):</p>
+
+<pre class="brush: js"><code>var myFunction = function() {
+ statements
+}</code></pre>
+
+<p>It is also possible to provide a name inside the definition in order to create a <strong>named</strong> function expression:</p>
+
+<pre class="brush: js"><code>var myFunction = function namedFunction(){
+ statements
+}</code></pre>
+
+<p>One of the benefits of creating a named function expression is that in case we encountered an error, the stack trace will contain the name of the function, making it easier to find the origin of the error.</p>
+
+<p>As we can see, both examples do not start with the <code>function</code> keyword. Statements involving functions which do not start with <code>function</code> are function expressions.</p>
+
+<p>When functions are used only once, a common pattern is an <a href="https://developer.mozilla.org/en-US/docs/Glossary/IIFE">IIFE (Immediately Invokable Function Expression)</a>.</p>
+
+<pre class="brush: js"><code>(function() {
+ statements
+})();</code></pre>
+
+<p>IIFE are function expressions that are invoked as soon as the function is declared.</p>
+
+<h3 id="생성기_함수_선언_function*_문">생성기 함수 선언 (<code>function*</code> 문)</h3>
+
+<p>생성기 함수 선언을 위한 특별한 구문이 있습니다 (자세한 사항은 {{jsxref('Statements/function*', 'function* statement')}} 참조):</p>
+
+<pre class="brush: js">function* <em>name</em>([<em>param</em>[, <em>param</em>[, ... <em>param</em>]]]) {
+ <em>statements</em>
+}
+</pre>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd>함수 이름.</dd>
+</dl>
+
+<dl>
+ <dt><code>param</code></dt>
+ <dd>함수에 전달되는 인수의 이름.</dd>
+</dl>
+
+<dl>
+ <dt><code>statements</code></dt>
+ <dd>함수의 몸통을 구성하는 문.</dd>
+</dl>
+
+<h3 id="생성기_함수_식_function*_식">생성기 함수 식 (<code>function*</code> 식)</h3>
+
+<p>생성기 함수 식은 생성기 함수 선언과 비슷하고 구문이 같습니다 (자세한 사항은 {{jsxref('Operators/function*', 'function* expression')}} 참조):</p>
+
+<pre class="brush: js">function* [<em>name</em>]([<em>param</em>[, <em>param</em>[, ... <em>param</em>]]]) {
+ <em>statements</em>
+}
+</pre>
+
+<dl>
+ <dt><code>name</code></dt>
+ <dd>함수 이름. 함수가 익명 함수인 경우 생략될 수 있음.</dd>
+</dl>
+
+<dl>
+ <dt><code>param</code></dt>
+ <dd>함수에 전달되는 인수의 이름.</dd>
+ <dt><code>statements</code></dt>
+ <dd>함수의 몸통을 구성하는 문.</dd>
+</dl>
+
+<h3 id="화살표_함수_표현식_>">화살표 함수 표현식 (=&gt;)</h3>
+
+<p>화살표 함수 식은 구문이 더 짧고 어휘상(lexically) <code>this</code> 값을 바인딩합니다 (자세한 사항은 <a href="/ko/docs/Web/JavaScript/Reference/Functions/애로우_펑션" title="arrow functions">화살표 함수</a> 참조):</p>
+
+<pre class="brush: js">([param[, param]]) =&gt; {
+ statements
+}
+
+param =&gt; expression
+</pre>
+
+<dl>
+ <dt><code>param</code></dt>
+ <dd>인수의 이름. 0개 인수는 <code>()</code>로 표시돼야 합니다. 인수가 1개뿐이면, 괄호는 필요치 않습니다. (<code>foo =&gt; 1</code>처럼)</dd>
+ <dt><code>statements or expression</code></dt>
+ <dd>선언문이 여러개인 경우 괄호로 묶여야 합니다. 단일 식(expression)은 괄호가 필요 없습니다. 그리고 식은 암시적으로(implicit) 함수의 반환값이 됩니다.</dd>
+</dl>
+
+<h3 id="Function_constructor"><code>Function</code> constructor</h3>
+
+<div class="note">
+<p><strong>참고</strong> : <code>Function</code> constructor를 사용하여 함수를 만드는 것은 권장되지 않습니다. 함수 본문을 일부 JS 엔진 최적화를 방해 할 수있는 문자열로 사용해야하고 다른 문제를 유발할 수 있기 때문입니다.</p>
+</div>
+
+<p>다른 모든 객체처럼, {{jsxref("Function")}} 객체는 <code>new</code> 연산자를 사용하여 생성될 수 있습니다:</p>
+
+<pre class="brush: js">new Function (<em>arg1</em>, <em>arg2</em>, ... <em>argN</em>, <em>functionBody</em>)
+</pre>
+
+<dl>
+ <dt><code>arg1, arg2, ... arg<em>N</em></code></dt>
+ <dd>형식 매개변수로 함수에 의해 사용되는 0개 이상의 이름. 각각은 알맞은 JavaScript 식별자(identifier)여야 합니다.</dd>
+</dl>
+
+<dl>
+ <dt><code>functionBody</code></dt>
+ <dd>함수 몸통을 구성하는 JavaScript 문을 포함하는 문자열.</dd>
+</dl>
+
+<p>함수로 <code>Function</code> 생성자 호출(<code>new</code> 연산자 사용 없이)하는 것은 생성자로 호출하는 것과 같습니다.</p>
+
+<h3 id="GeneratorFunction_생성자"><code>GeneratorFunction</code> 생성자</h3>
+
+<div class="note">
+<p><strong>주의:</strong> <code>GeneratorFunction</code>은 전역 객체가 아니지만 생성기 함수 인스턴스로부터 얻을 수 있습니다(자세한 사항은 {{jsxref("GeneratorFunction")}} 참조).</p>
+</div>
+
+<div class="note">
+<p><strong>주의:</strong> <code>GeneratorFunction</code> 생성자를 사용하여 함수를 만드는 것은 권장되지 않습니다. 함수 본문을 일부 JS 엔진 최적화를 방해 할 수있는 문자열로 사용해야하고 다른 문제를 유발할 수 있기 때문입니다.</p>
+</div>
+
+<p>다른 모든 객체처럼, {{jsxref("GeneratorFunction")}} 객체는 <code>new</code> 연산자를 사용하여 생성될 수 있습니다:</p>
+
+<pre class="brush: js">new GeneratorFunction (<em>arg1</em>, <em>arg2</em>, ... <em>argN</em>, <em>functionBody</em>)
+</pre>
+
+<dl>
+ <dt><code>arg1, arg2, ... arg<em>N</em></code></dt>
+ <dd>형식 인수명으로 함수에 의해 사용되는 0개 이상의 이름. 각각은 유효한 JavaScript 식별자 규칙을 따르는 문자열 또는 콤마로 구분된 그러한 문자열 목록이어야 합니다; 예를 들어 "<code>x</code>", "<code>theValue</code>" 또는 "<code>a,b</code>".</dd>
+</dl>
+
+<dl>
+ <dt><code>functionBody</code></dt>
+ <dd>함수 정의를 구성하는 JavaScript 문을 포함하는 문자열.</dd>
+</dl>
+
+<p>함수로서 <code>Function</code> 생성자 호출(<code>new</code> 연산자 사용 없이)은 생성자로서 호출하는 것과 같은 효과입니다.</p>
+
+<h2 id="Function_매개변수">Function 매개변수</h2>
+
+<h3 id="기본_매개변수">기본 매개변수</h3>
+
+<p>기본(default) 함수 매개변수는 전달된 값이 없거나 <code>undefined</code>인 경우 기본값으로 초기화되는 형식 매개변수를 허용합니다. 자세한 사항은, <a href="/ko/docs/Web/JavaScript/Reference/Functions/Default_parameters" title="default parameters">기본 매개변수</a> 참조.</p>
+
+<h3 id="나머지_매개변수">나머지 매개변수</h3>
+
+<p>나머지(rest) 매개변수 구문은 부정(indefinite)수인 인수를 배열로 나타내는 것을 허용합니다. 자세한 사항은, <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="rest parameters">나머지 매개변수</a> 참조.</p>
+
+<h2 id="arguments_객체"><code>arguments</code> 객체</h2>
+
+<p><code>arguments</code> 객체를 사용하여 함수 내에서 함수의 인수를 참조할 수 있습니다. <a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a> 참조.</p>
+
+<ul>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a></code>: 현재 실행 중인 함수에 전달된 인수를 포함하는 배열 같은 객체.</li>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/callee">arguments.callee</a></code> {{Deprecated_inline}} : 현재 실행 중인 함수.</li>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/caller">arguments.caller</a></code> {{Obsolete_inline}} : 현재 실행 중인 함수를 호출한 함수.</li>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments/length">arguments.length</a></code>: 함수에 전달된 인수의 수.</li>
+</ul>
+
+<h2 id="메서드_함수_정의하기">메서드 함수 정의하기</h2>
+
+<h3 id="getter_및_setter_함수">getter 및 setter 함수</h3>
+
+<p>모든 표준 내장 객체 또는 새로운 속성 추가를 지원하는 사용자 정의 객체에 getter(accessor 메서드) 및 setter(mutator 메서드)를 정의할 수 있습니다. getter 및 setter를 정의하는 구문은 객체 리터럴 구문을 사용합니다.</p>
+
+<dl>
+ <dt><a href="/ko/docs/Web/JavaScript/Reference/Functions/get">get</a></dt>
+ <dd>
+ <p>객체 속성을 그 속성이 검색되는 경우 호출되는 함수에 바인딩합니다.</p>
+ </dd>
+ <dt><a href="/ko/docs/Web/JavaScript/Reference/Functions/set">set</a></dt>
+ <dd>객체 속성을 그 속성을 설정하려는 시도가 있는 경우 호출되는 함수에 바인딩합니다.</dd>
+</dl>
+
+<h3 id="메서드_정의_구문">메서드 정의 구문</h3>
+
+<p>ECMAScript 2015를 시작으로, getter 및 setter와 비슷한 단축 구문으로 자신의 메서드를 정의할 수 있습니다. 더 자세한 정보는 <a href="/ko/docs/Web/JavaScript/Reference/Functions/Method_definitions">메서드 정의</a> 참조.</p>
+
+<pre class="brush: js">var obj = {
+ foo() {},
+  bar() {}
+};</pre>
+
+<h2 id="생성자_vs._선언문_vs._표현식">생성자 vs. 선언문 vs. 표현식</h2>
+
+<p>다음을 비교해보세요:</p>
+
+<p><code>Function</code> <em>constructor로 정의된 함수를 </em>변수<code>multiply</code>에 할당.</p>
+
+<pre class="brush: js"><code>var multiply = new Function('x', 'y', 'return x * y');</code></pre>
+
+<p>이름이 <code>multiply</code>인 함수 선언:</p>
+
+<pre class="brush: js">function multiply(x, y) {
+ return x * y;
+}
+</pre>
+
+<p>변수 <code>multiply</code>에 할당된 익명(anonymous) 함수의 <em>function 식</em>:</p>
+
+<pre class="brush: js">var multiply = function(x, y) {
+ return x * y;
+};
+</pre>
+
+<p>변수 <code>multiply</code>에 할당된 이름이 <code>func_name</code>인 함수의 <em>function 식</em>:</p>
+
+<pre class="brush: js">var multiply = function func_name(x, y) {
+ return x * y;
+};
+</pre>
+
+<h3 id="차이">차이</h3>
+
+<p>모두 거의 같은 일을 하지만 약간 미묘한 차이가 있습니다:</p>
+
+<p>함수 이름과 함수가 할당 된 변수 사이에는 차이가 있습니다. 함수 이름을 변경할 수 없으며 함수가 할당 된 변수는 다시 할당 할 수 있습니다. 함수 이름은 함수 본문(body)내에서만 사용할 수 있습니다. 함수 본문(body) 외부에서 사용하려고 하면 오류가 발생합니다. (함수 이름이 <code>var</code> 문을 통해 이전에 선언 된 경우에는 정의되지 않습(<code>undefined</code>)니다.</p>
+
+<p>예를 들어:</p>
+
+<pre class="brush: js">var y = function x() {};
+alert(x); // 오류 발생
+</pre>
+
+<p>함수 이름은 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function/toString"><code>Function</code>의 toString 메서드</a>를 통해 직렬화되는 경우에도 보입니다.</p>
+
+<p>반면에 함수가 할당 된 변수는 함수의 범위(scope)가 포함되도록 보장 된 범위로만 제한됩니다.</p>
+
+<p>예제 4에서 볼 수 있듯이 함수 이름은 함수가 할당 된 변수와 다를 수 있습니다. 그들은 서로에게 아무런 관련이 없습니다. 함수 선언은 함수 이름과 동일한 이름의 변수도 만듭니다. 따라서 함수 표현식으로 정의 된 함수와 달리 함수 선언으로 정의 된 함수는 정의 된 범위에서 함수 선언의 이름으로 액세스 할 수 있습니다.</p>
+
+<p>'<code>new Function</code>'으로 정의된 함수는 함수 이름이 없습니다. 그러나, <a href="/ko/docs/SpiderMonkey">SpiderMonkey</a> JavaScript 엔진에서는, 함수의 직렬화된 형태가 마치 그 이름이 "anonymous"인 것처럼 보입니다. 예를 들어, <code>alert(new Function())</code>은 다음을 출력합니다:</p>
+
+<pre class="brush: js">function anonymous() {
+}
+</pre>
+
+<p>함수가 실제로는 이름이 없기에, <code>anonymous</code>는 함수 내에서 액세스될 수 있는 변수가 아닙니다.</p>
+
+<p>다음 코드는 오류가 날 것입니다:</p>
+
+<pre class="brush: js">var foo = new Function("alert(anonymous);");
+foo();
+</pre>
+
+<p>function 식 또는 <code>Function</code> 생성자에 의해 정의된 함수와는 달리, function 선언으로 정의된 함수는 function 자체의 선언 전에 사용될 수 있습니다. 예를 들어:</p>
+
+<pre class="brush: js">foo(); // alerts FOO!
+function foo() {
+ alert('FOO!');
+}
+</pre>
+
+<p>함수 표현식(function expression)이나 함수 선언(function declaration)에 의해 정의 된 함수는 현재 범위를 상속합니다. 즉,이 함수는 클로저를 형성합니다. 반면에 <code>Function</code> 생성자가 정의한 함수는 전역 범위 (모든 함수가 상속) 이외의 다른 범위를 상속하지 않습니다.</p>
+
+<pre class="brush: js"><code>/*
+ * Declare and initialize a variable 'p' (global)
+ * and a function 'myFunc' (to change the scope) inside which
+ * declare a varible with same name 'p' (current) and
+ * define three functions using three different ways:-
+ * 1. function declaration
+ * 2. function expression
+ * 3. function constructor
+ * each of which will log 'p'
+ */
+var p = 5;
+function myFunc() {
+ var p = 9;
+
+ function decl() {
+ console.log(p);
+ }
+ var expr = function() {
+ console.log(p);
+ };
+ var cons = new Function('\tconsole.log(p);');
+
+ decl();
+ expr();
+ cons();
+}
+myFunc();
+
+/*
+ * Logs:-
+ * 9 - for 'decl' by function declaration (current scope)
+ * 9 - for 'expr' by function expression (current scope)
+ * 5 - for 'cons' by Function constructor (global scope)
+ */</code></pre>
+
+<p>function 식 및 function 선언에 의해 정의된 함수는 한 번만 구문 분석됩니다, 반면에 <code>Function</code> 생성자에 의해 정의된 함수는 아닙니다. 즉, <code>Function</code> 생성자에 전달된 함수 몸통 문자열은 생성자가 호출될 때마다 구문 분석되어야 합니다. function 식이 매번 closure를 만들더라도, 함수 몸통은 다시 구문 분석되지 않습니다, 그래서 function 식은 "<code>new Function(...)</code>"보다 여전히 더 빠릅니다. 따라서 <code>Function</code> 생성자는 보통 가능한 한 피해야 합니다.</p>
+
+<p>함수 식과 함수 선언으로 정의 된 함수는 한 번만 구문 분석되지만 <code>Function</code> 생성자로 정의 된 함수는 구문 분석되지 않습니다. 즉, <code>Function</code> 생성자에 전달 된 함수 본문 문자열은 생성자가 호출 될 때마다 파싱되어야합니다. 함수식이 매번 클로저(closure)를 만들지만 함수 본문은 다시 파싱되지 않으므로 함수 식은 여전히 ​​"<code>new Function (...)</code>"보다 빠릅니다. 따라서 <code>Function</code> 생성자는 가능한 피하는 것이 좋습니다.</p>
+
+<p>그러나 <code>Function constructor</code>의 문자열을 구문 분석하여 생성된 함수 내에 중첩된 function 식 및 function 선언은 반복해서 구문 분석되지 않음에 주의해야 합니다. 예를 들면:</p>
+
+<pre class="brush: js">var foo = (new Function("var bar = \'FOO!\';\nreturn(function() {\n\talert(bar);\n});"))();
+foo(); // 함수 몸통 문자열의 "function() {\n\talert(bar);\n}" 부분은 다시 구문 분석되지 않습니다.</pre>
+
+<p>function 선언은 매우 쉽게 (그리고 종종 무심코) function 식으로 바뀝니다. function 선언은 다음 어느 쪽이든 function 식이 되는 것을 중단합니다:</p>
+
+<ul>
+ <li>식의 일부가 된 경우</li>
+ <li>더 이상 함수 또는 스크립트 자체의 "source 요소"가 아닌 경우. "source 요소"는 스크립트 또는 함수 몸통에서 중첩되지 않은 문입니다:</li>
+</ul>
+
+<pre class="brush: js">var x = 0; // source 요소
+if (x == 0) { // source 요소
+ x = 10; // source 요소가 아님
+ function boo() {} // source 요소가 아님
+}
+function foo() { // source 요소
+ var y = 20; // source 요소
+ function bar() {} // source 요소
+ while (y == 10) { // source 요소
+ function blah() {} // source 요소가 아님
+ y++; // source 요소가 아님
+ }
+}
+</pre>
+
+<h3 id="예">예</h3>
+
+<pre class="brush: js">// function 선언
+function foo() {}
+
+// function 식
+(function bar() {})
+
+// function 식
+x = function hello() {}
+
+
+if (x) {
+ // function 식
+ function world() {}
+}
+
+
+// function 선언
+function a() {
+ // function 선언
+ function b() {}
+ if (0) {
+ // function 식
+ function c() {}
+ }
+}
+</pre>
+
+<h2 id="블록_레벨_함수">블록 레벨 함수</h2>
+
+<p>ES2015 (ES6)를 시작으로 <a href="/ko/docs/Web/JavaScript/Reference/Strict_mode" title="strict mode">엄격 모드</a>에서, 블록 내부 함수는 이제 그 블록 범위가 됩니다. ES6 이전에, 블록 레벨 함수는 엄격 모드에서 금지됐습니다.</p>
+
+<pre class="brush: js">'use strict';
+
+function f() {
+ return 1;
+}
+
+{
+ function f() {
+ return 2;
+ }
+}
+
+f() === 1; // true
+
+// 비엄격 모드에서는 f() === 2
+</pre>
+
+<h3 id="비엄격_코드에서_블록_레벨_함수">비엄격 코드에서 블록 레벨 함수</h3>
+
+<p>한 마디로: 안됩니다.</p>
+
+<p>비엄격 코드에서, 블록 내부 function 선언은 이상하게 동작합니다. 예를 들면:</p>
+
+<pre class="brush: js">if (shouldDefineZero) {
+ function zero() { // 위험: 호환성 위험
+ console.log("This is zero.");
+ }
+}
+</pre>
+
+<p>ES2015는 <code>shouldDefineZero</code>가 false인 경우, 그러면 <code>zero</code>는 결코 정의되어서는 안된다고 합니다, 그 블록이 실행된 적이 없기에. 그러나, 이는 표준의 새로운 일부입니다. 역사상, 이는 지정되지 않은 채 방치되었고 일부 브라우저는 블록이 실행됐든 아니든 <code>zero</code>를 정의할 겁니다.</p>
+
+<p><a href="/ko/docs/Web/JavaScript/Reference/Strict_mode" title="strict mode">엄격 모드</a>에서, ES2015를 지원하는 모든 브라우저는 이를 같은 식으로 다룹니다: <code>zero</code>는 <code>shouldDefineZero</code>가 true이고 <code>if</code> 블록 범위인 경우에만 정의됩니다.</p>
+
+<p>조건부 함수를 정의하는 더 안전한 방법은 function 식을 변수에 할당하는 것입니다:</p>
+
+<pre class="brush: js">var zero;
+if (0) {
+ zero = function() {
+ console.log("This is zero.");
+ };
+}
+</pre>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="형식_갖춘_숫자_반환하기">형식 갖춘 숫자 반환하기</h3>
+
+<p>다음 함수는 선행 0으로 채워진 형식 갖춘(formatted) 숫자 표현을 포함하는 문자열을 반환합니다.</p>
+
+<pre class="brush: js">// 이 함수는 선행 0으로 채워진 문자열을 반환
+function padZeros(num, totalLen) {
+ var numStr = num.toString(); // 문자열로 반환값을 초기화
+ var numZeros = totalLen - numStr.length; // 0의 개수 계산
+ for (var i = 1; i &lt;= numZeros; i++) {
+ numStr = "0" + numStr;
+ }
+ return numStr;
+}
+</pre>
+
+<p>다음 문은 padZeros 함수를 호출합니다.</p>
+
+<pre class="brush: js">var result;
+result = padZeros(42,4); // 반환값 "0042"
+result = padZeros(42,2); // 반환값 "42"
+result = padZeros(5,4); // 반환값 "0005"
+</pre>
+
+<h3 id="함수_존재_여부_결정하기">함수 존재 여부 결정하기</h3>
+
+<p><code>typeof</code> 연산자를 사용하여 함수가 존재하는지 여부를 결정할 수 있습니다. 다음 예에서, <code>window</code> 객체가 함수인 <code>noFunc</code>이라고 하는 속성이 있는지 결정하기 위해 테스트가 수행됩니다. 있으면, 사용됩니다; 그렇지 않으면 무언가 다른 행동을 취합니다.</p>
+
+<pre class="brush: js"> if ('function' == typeof window.noFunc) {
+ // noFunc() 사용
+ } else {
+ // 뭔가 다른 것 수행
+ }
+</pre>
+
+<p><code>if</code> 테스트에는, <code>noFunc</code>에 대한 참조가 사용되고—실제 함수가 호출되지 않도록 함수 이름 뒤에 괄호 "()"가 없음을 주의하세요.</p>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">명세</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>초기 정의. JavaScript 1.0에서 구현됨</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-13', 'Function Definition')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-function-definitions', 'Function definitions')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>신규: 화살표 함수, 생성기 함수, 기본 매개변수, 나머지 매개변수.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-function-definitions', 'Function definitions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("javascript.functions")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Statements/function", "function 문")}}</li>
+ <li>{{jsxref("Operators/function", "function 식")}}</li>
+ <li>{{jsxref("Statements/function*", "function* 문")}}</li>
+ <li>{{jsxref("Operators/function*", "function* 식")}}</li>
+ <li>{{jsxref("Function")}}</li>
+ <li>{{jsxref("GeneratorFunction")}}</li>
+ <li>{{jsxref("Functions/애로우_펑션", "화살표 함수")}}</li>
+ <li>{{jsxref("Functions/Default_parameters", "기본 매개변수")}}</li>
+ <li>{{jsxref("Functions/rest_parameters", "나머지 매개변수")}}</li>
+ <li>{{jsxref("Functions/arguments", "arguments 객체")}}</li>
+ <li>{{jsxref("Functions/get", "getter")}}</li>
+ <li>{{jsxref("Functions/set", "setter")}}</li>
+ <li>{{jsxref("Functions/Method_definitions", "메서드 정의")}}</li>
+ <li><a href="/ko/docs/Web/JavaScript/Reference/Functions" title="Functions and function scope">함수 및 함수 범위</a></li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/method_definitions/index.html b/files/ko/web/javascript/reference/functions/method_definitions/index.html
new file mode 100644
index 0000000000..ff1b67956a
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/method_definitions/index.html
@@ -0,0 +1,230 @@
+---
+title: 메서드 정의
+slug: Web/JavaScript/Reference/Functions/Method_definitions
+tags:
+ - ECMAScript 2015
+ - Functions
+ - JavaScript
+ - Object
+ - Syntax
+translation_of: Web/JavaScript/Reference/Functions/Method_definitions
+---
+<div>{{JsSidebar("Functions")}}</div>
+
+<p>ECMAScript 2015 를 시작으로, 객체 초기자(initializer)에 메서드 정의를 위한 더 짧은 구문이 도입되었습니다. 이는 메서드 명에 할당된 함수를 위한 단축입니다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">var obj = {
+ <var>property</var>( <var>parameters…</var> ) {},
+ *<var>generator</var>( <var>parameters…</var> ) {},
+// 키(속성) 계산값과도 함께:
+ [property]( <var>parameters…</var> ) {},
+ *[generator]( <var>parameters…</var> ) {},
+// ES5 getter/setter 구문과 비교해 보세요:
+ get <var>property</var>() {},
+ set <var>property</var>(<var>value</var>) {}
+};
+</pre>
+
+<h2 id="설명">설명</h2>
+
+<p>단축 구문은 ECMAScript 5에 도입된 <a href="/ko/docs/Web/JavaScript/Reference/Functions/get">getter</a> 및 <a href="/ko/docs/Web/JavaScript/Reference/Functions/set">setter</a> 구문과 비슷합니다.</p>
+
+<p>다음 코드가 주어지면:</p>
+
+<pre class="brush: js">var obj = {
+ foo: function() {},
+ bar: function() {}
+};</pre>
+
+<p>이제 이를 아래로 줄일 수 있습니다:</p>
+
+<pre class="brush: js">var obj = {
+ foo() {},
+ bar() {}
+};</pre>
+
+<div class="note">
+<p><strong>주의 :</strong> 단축 구문은 익명(anonymous) 함수 (…<code>foo: function() {}</code>… 에서처럼) 대신 유명(named) 함수를 사용합니다. 유명 함수는 함수 본체에서 호출될 수 있습니다 (이는 참조할 식별자가 없기에 익명 함수에게는 불가능합니다). 자세한 사항은, {{jsxref("Operators/function","function","#Examples")}} 참조.</p>
+</div>
+
+<h3 id="단축_생성기_메서드">단축 생성기 메서드</h3>
+
+<p><a href="/ko/docs/Web/JavaScript/Reference/Statements/function*">생성기 메서드</a>는 단축 구문을 사용해서도 정의될 수 있습니다. 단축 구문 내 별표(*)는 생성기 속성명 앞에 와야 함을 주의하세요. 즉, <code>* g(){}</code>는 작동하지만 <code>g *(){}</code>는 아닙니다.</p>
+
+<pre class="brush: js;highlight[12]">// 유명 속성 사용 (ES2015 이전)
+var obj2 = {
+ g: function*() {
+ var index = 0;
+ while(true)
+ yield index++;
+ }
+};
+
+// 단축 구문을 쓰는 같은 객체
+var obj2 = {
+ * g() {
+ var index = 0;
+ while(true)
+ yield index++;
+ }
+};
+
+var it = obj2.g();
+console.log(it.next().value); // 0
+console.log(it.next().value); // 1</pre>
+
+<h3 id="메서드_정의는_생성_불가능합니다">메서드 정의는 생성 불가능합니다</h3>
+
+<p>모든 메서드 정의는 생성자가 아니고 인스턴스화하려고 하는 경우 {{jsxref("TypeError")}} 예외가 발생합니다.</p>
+
+<pre class="brush: js example-bad">var obj = {
+ method() {},
+};
+new obj.method; // TypeError: obj.method는 생성자가 아닙니다
+
+var obj = {
+ * g() {}
+};
+new obj.g; // TypeError: obj.g는 생성자가 아닙니다 (ES2016에서 바뀜)
+</pre>
+
+<h2 id="예">예</h2>
+
+<h3 id="간단한_테스트_사례">간단한 테스트 사례</h3>
+
+<pre class="brush: js;highlight[3]">var obj = {
+ a : "foo",
+ b(){ return this.a; }
+};
+console.log(obj.b()); // "foo"
+</pre>
+
+<h3 id="속성_계산명">속성 계산명</h3>
+
+<p>단축 구문은 속성 계산명(computed property name)도 지원합니다.</p>
+
+<pre class="brush: js;highlight[4]">var bar = {
+ foo0 : function (){return 0;},
+ foo1(){return 1;},
+ ["foo" + 2](){return 2;},
+};
+
+console.log(bar.foo0()); // 0
+console.log(bar.foo1()); // 1
+console.log(bar.foo2()); // 2</pre>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">스펙</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES2015', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ES2015')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES7', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ES7')}}</td>
+ <td>생성기 메서드 역시 [[Construct]] 트랩이 없어야 하고 <code>new</code>와 함께 사용되는 경우 예외 발생으로 바뀜.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Method definition shorthand</td>
+ <td>{{CompatChrome("39")}}</td>
+ <td>{{CompatGeckoDesktop("34")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera("26")}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Generator methods are not constructable (ES2016)</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop("43")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Method definition shorthand</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatGeckoMobile("34")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Generator methods are not constructable (ES2016)</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile("43")}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="SpiderMonkey_전용_주의사항">SpiderMonkey 전용 주의사항</h2>
+
+<ul>
+ <li>SpiderMonkey 38 {{geckoRelease(38)}} 이전에, "<code>get</code>" 및 "<code>set</code>"은 생성기 메서드에 무효한 이름이었습니다. 이는 {{bug(1073809)}}에서 해결됐습니다.</li>
+ <li>SpiderMonkey 41 {{geckoRelease(41)}} 이전에, 중괄호는 메서드 정의에 필요하지 않았습니다. ES2015 스펙을 따르기 위해 이제부터 필요하고 이번과 이후 버전에서 {{jsxref("SyntaxError")}}가 발생합니다 ({{bug(1150855)}}).
+ <pre class="brush: js example-bad">var o = {x() 12}; // SyntaxError</pre>
+ </li>
+ <li>오직 생성기 메서드만이 생성자인 제한은 SpiderMonkey 41 {{geckoRelease(41)}}에서 구현되었습니다. {{bug(1059908)}} 및 {{bug(1166950)}} 참조.</li>
+</ul>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/get">get</a></code></li>
+ <li><code><a href="/ko/docs/Web/JavaScript/Reference/Functions/set">set</a></code></li>
+ <li><a href="/ko/docs/Web/JavaScript/Reference/Lexical_grammar" title="Lexical grammar">어휘 문법</a></li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/rest_parameters/index.html b/files/ko/web/javascript/reference/functions/rest_parameters/index.html
new file mode 100644
index 0000000000..eee5528b38
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/rest_parameters/index.html
@@ -0,0 +1,223 @@
+---
+title: Rest 파라미터
+slug: Web/JavaScript/Reference/Functions/rest_parameters
+tags:
+ - Functions
+ - JavaScript
+ - Rest
+ - Rest parameters
+translation_of: Web/JavaScript/Reference/Functions/rest_parameters
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><strong>Rest 파라미터</strong> 구문은 정해지지 않은 수(an indefinite number, 부정수) 인수를 배열로 나타낼 수 있게 합니다.</p>
+
+<p>{{EmbedInteractiveExample("pages/js/functions-restparameters.html")}}</p>
+
+<div class="hidden">
+<p>The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
+</div>
+
+<p> </p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="brush: js">function f(a, b, ...theArgs) {
+ // ...
+}
+</pre>
+
+<h2 id="설명">설명</h2>
+
+<p>함수의 마지막 파라미터의 앞에 <code>...</code> 를 붙여 (사용자가 제공한) 모든 나머지 인수를 "표준" 자바스크립트 배열로 대체합니다. 마지막 파라미터만 "Rest 파라미터" 가 될 수 있습니다.</p>
+
+<pre class="brush: js">function myFun(a, b, ...manyMoreArgs) {
+ console.log("a", a);
+ console.log("b", b);
+ console.log("manyMoreArgs", manyMoreArgs);
+}
+
+myFun("one", "two", "three", "four", "five", "six");
+
+// Console Output:
+// a, one
+// b, two
+// manyMoreArgs, [three, four, five, six]</pre>
+
+<p> </p>
+
+<h3 id="Rest_파라미터_및_arguments_객체간_차이">Rest 파라미터 및 <code>arguments</code> 객체간 차이</h3>
+
+<p>Rest 파라미터와 <a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments" title="arguments"><code>arguments</code></a> 객체 사이에 세 가지 주요 차이점이 있습니다:</p>
+
+<ul>
+ <li>Rest 파라미터는 구분된 이름(예, 함수 표현에 정식으로 정의된 것)이 주어지지 않은 유일한 대상인 반면, <code>arguments</code> 객체는 함수로 전달된 모든 인수를 포함합니다.</li>
+ <li><code>arguments</code> 객체는 실제 배열이 아니고 rest 파라미터는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Array" title="Array"><code>Array</code></a> 인스턴스로, <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" title="Array sort method"><code>sort</code></a>, <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/map" title="Array map method"><code>map</code></a>, <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach" title="Array forEach method"><code>forEach</code></a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/pop" title="Array pop method"><code>pop</code></a> 같은 메서드가 바로 인스턴스에 적용될 수 있음을 뜻합니다.</li>
+ <li>즉 <code>arguments</code> 객체는 자체에 특정 추가 기능이 있습니다 (<code>callee</code> 속성처럼).</li>
+</ul>
+
+<h3 id="arguments에서_배열까지">arguments에서 배열까지</h3>
+
+<p>Rest 파라미터는 인수에 의해 유발된 상용구(boilerplate) 코드를 줄이기 위해 도입되었습니다.</p>
+
+<pre class="brush: js">// Rest 파라미터 이전에, "arguments" 는 다음을 사용해 일반적인 배열로 변환될 수 있음
+
+function f(a, b) {
+
+ var normalArray = Array.prototype.slice.call(arguments);
+ // -- 또는 --
+ var normalArray = [].slice.call(arguments);
+ // -- 또는 --
+ var normalArray = Array.from(arguments);
+
+ var first = normalArray.shift(); // OK, 첫 번째 인수를 반환
+ var first = arguments.shift(); // ERROR (arguments 가 일반적인 배열이 아님)
+
+}
+
+// 이제 rest 파라미터를 사용해 쉽게 일반적인 배열에 접근할 수 있음
+
+function f(...args) {
+ var normalArray = args;
+ var first = normalArray.shift(); // OK, 첫 번째 인수를 반환
+}</pre>
+
+<h3 id="Rest_파라미터_해체">Rest 파라미터 해체</h3>
+
+<p>Rest 파라미터는 해체될 수 있습니다(배열로만). 이는 데이터가 구분된 변수로 해체될 수 있음을 의미합니다. <a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">구조 분해 할당</a> 문서를 보세요.</p>
+
+<pre class="brush: js">function f(...[a, b, c]) {
+ return a + b + c;
+}
+
+f(1) // NaN (b 와 c 는 undefined)
+f(1, 2, 3) // 6
+f(1, 2, 3, 4) // 6 (4번 째 파라미터는 해체되지 않음)</pre>
+
+<h2 id="예제">예제</h2>
+
+<p>이 예제에서, 첫 번째 인수는 <code>"a"</code>, 두 번째 인수는 <code>"b"</code> 로 매핑되어, 일반적인 유명 인수와 같이 사용됩니다. 반면에 3번 째 인수 <code>"manyMoreArgs"</code> 는 사용자가 포함시킨 인수를 포함하는 배열이 됩니다.</p>
+
+<pre class="brush: js">function myFun(a, b, ...manyMoreArgs) {
+ console.log("a", a);
+ console.log("b", b);
+ console.log("manyMoreArgs", manyMoreArgs);
+}
+
+myFun("one", "two", "three", "four", "five", "six");
+
+// a, one
+// b, two
+// manyMoreArgs, [three, four, five, six]</pre>
+
+<p>아래를 보면, 하나의 값만 있더라도 마지막 인수는 여전히 배열을 갖습니다.</p>
+
+<pre class="brush: js">// 위 예제와 동일한 함수 정의를 사용
+
+myFun("one", "two", "three");
+
+// a, one
+// b, two
+// manyMoreArgs, [three]</pre>
+
+<p>아래를 보면, 3번 째 인수가 제공되지 않더라도, "manyMoreArgs" 는 여전히 배열입니다(비어있긴하지만).</p>
+
+<pre class="brush: js">// 위 예제와 동일한 함수 정의를 사용
+
+myFun("one", "two");
+
+// a, one
+// b, two
+// manyMoreArgs, []</pre>
+
+<p><code>theArgs</code> 가 배열이므로, <code>length</code> 프로퍼티를 사용해 엘리먼트의 수를 얻을 수 있습니다.</p>
+
+<pre class="brush: js">function fun1(...theArgs) {
+ console.log(theArgs.length);
+}
+
+fun1(); // 0
+fun1(5); // 1
+fun1(5, 6, 7); // 3</pre>
+
+<p>다음 예제에서, rest 파라미터는 첫 번째 인수 다음의 모든 인수를 배열로 모으는데 사용됩니다. 각각은 첫 번째 파라미터와 곱해져 배열로 반환됩니다.</p>
+
+<pre class="brush: js">function multiply(multiplier, ...theArgs) {
+ return theArgs.map(function(element) {
+ return multiplier * element;
+ });
+}
+
+var arr = multiply(2, 1, 2, 3);
+console.log(arr); // [2, 4, 6]</pre>
+
+<p><code>Array</code> 메소드는 rest 파라미터에서 사용될 수 있지만, <code>arguments</code> 객체에서는 그렇지 않습니다.</p>
+
+<pre class="brush: js">function sortRestArgs(...theArgs) {
+ var sortedArgs = theArgs.sort();
+ return sortedArgs;
+}
+
+console.log(sortRestArgs(5, 3, 7, 1)); // 1, 3, 5, 7
+
+function sortArguments() {
+ var sortedArgs = arguments.sort();
+ return sortedArgs; // this will never happen
+}
+
+
+console.log(sortArguments(5, 3, 7, 1)); // TypeError (arguments.sort is not a function)</pre>
+
+<p><code>arguments</code> 객체에서 <code>Array</code> 메소드를 사용하려면, 이를 먼저 실제 배열로 변환해야합니다.</p>
+
+<pre class="brush: js">function sortArguments() {
+ var args = Array.from(arguments);
+ var sortedArgs = args.sort();
+ return sortedArgs;
+}
+console.log(sortArguments(5, 3, 7, 1)); // 1, 3, 5, 7
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">명세</th>
+ <th scope="col">상태</th>
+ <th scope="col">설명</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-function-definitions', 'Function Definitions')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>초기 정의.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-function-definitions', 'Function Definitions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p> </p>
+
+<div class="hidden">
+<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+</div>
+
+<p>{{Compat("javascript.functions.rest_parameters")}}</p>
+
+<h2 id="함께_보기">함께 보기</h2>
+
+<ul>
+ <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Spread_syntax" title="spread operator">Spread 문법</a> (또한 ‘<code>...</code>’)</li>
+ <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/arguments" title="arguments">Arguments 객체</a></li>
+ <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array" title="Array">Array</a></li>
+ <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions" title="Functions and function scope">함수</a></li>
+ <li><a href="http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters">Original proposal at ecmascript.org</a></li>
+ <li><a href="http://javascriptweblog.wordpress.com/2011/01/18/javascripts-arguments-object-and-beyond/">JavaScript arguments object and beyond</a></li>
+ <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">구조 분해 할당</a></li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/set/index.html b/files/ko/web/javascript/reference/functions/set/index.html
new file mode 100644
index 0000000000..248a218c37
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/set/index.html
@@ -0,0 +1,208 @@
+---
+title: setter
+slug: Web/JavaScript/Reference/Functions/set
+translation_of: Web/JavaScript/Reference/Functions/set
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p><strong><code>set</code></strong> syntax는 어떤 객체의 속성에 이 속성을 설정하려고 할 때 호출되는 함수를 바인드한다.</p>
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox">{set <em>prop</em>(<em>val</em>) { . . . }}
+{set [expression](<em>val</em>) { . . . }}</pre>
+
+<h3 id="매개변수">매개변수</h3>
+
+<dl>
+ <dt><code>prop</code></dt>
+ <dd>주어진 함수를 바인드할 속성의 이름</dd>
+</dl>
+
+<dl>
+ <dt><code>val</code></dt>
+ <dd><code>prop에 설정될 값을 가지고 있는 변수의 별명.</code></dd>
+ <dt>expression</dt>
+ <dd>ECMAScript 6부터는, 주어진 함수에 바인드 되는 속성 이름은 계산(computed)을 통해 얻을 수 있고 이것을 위한 expressions을 사용할 수 있다.</dd>
+</dl>
+
+<h2 id="설명">설명</h2>
+
+<p> 자바스크립트에서, setter는 특정한 속성에 값이 변경되어 질 때마다 함수를 실행하는데 사용될 수 있다. Setter는 유사(pseudo)-property 타입을 생성하는 getter와 함께 가장 자주 사용된다. 실제 값을 가지는 property와 이  property의 setter 를  동시에 갖는 것은 불가능하다.</p>
+
+<p><code>set</code> 문법을 사용할 때 다음을 주의한다:</p>
+
+<div>
+<ul>
+ <li>숫자혹은 문자로된 식별자를 가질 수 있다;</li>
+ <li>한 개의 파라메터만 가질 수 있다.(더 자세한 정보는 <a class="external" href="http://whereswalden.com/2010/08/22/incompatible-es5-change-literal-getter-and-setter-functions-must-now-have-exactly-zero-or-one-arguments/" rel="external nofollow">Incompatible <abbr title="ECMAScript 5th edition">ES5</abbr> change: literal getter and setter functions must now have exactly zero or one arguments</a>를 본다);</li>
+ <li>오브젝트 리터럴에 동일한 property에 대한  다른 set나  데이터 항목이 올 수 없다.<br>
+ ( <code>{ set x(v) { }, set x(v) { } }</code> 그리고 <code>{ x: ..., set x(v) { } }</code> 는 허용되지 않는다.)</li>
+</ul>
+</div>
+
+<p>setter는   <a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete" title="en-US/docs/JavaScript/Reference/Operators/Special/delete"><code>delete</code></a> operator를 사용하여 제거할 수 있다.</p>
+
+<h2 id="예">예</h2>
+
+<h3 id="새로운_객체의_setter를_객체의_initializer에서_정의하기">새로운 객체의 setter를 객체의 initializer에서 정의하기 </h3>
+
+<p>다음은 객체 o의 유사 프로러티(pseudo-property )인 <code>current를 정의한다. 이것은 값이 설정될 때, 이 값으로 로그를 갱신 한다.</code></p>
+
+<pre class="brush: js">var o = {
+ set current (str) {
+ this.log[this.log.length] = str;
+ },
+ log: []
+}
+</pre>
+
+<p><code><font face="Open Sans, Arial, sans-serif">다음 사항에 주의한다. </font>current는 정의 되지 않았고 이것에 접근하는 모든 시도는 undefined 값을 얻게될 것이다.</code></p>
+
+<h3 id="delete_operator로_setter를_제거하기"><code>delete</code> operator로 setter를 제거하기</h3>
+
+<p>만약 setter를 제거하기 원한다면, 그냥 그것을 <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete">delete</a></code> 하면 된다:</p>
+
+<pre class="brush: js">delete o.current;
+</pre>
+
+<h3 id="defineProperty를_사용하여_이미_존재하는_객체에_setter를_정의하기"><code>defineProperty를 사용하여 이미 존재하는 객체에 </code>setter를 정의하기</h3>
+
+<p>setter를 이미 존재하는 object에 나중에 언제라도 추가하기 위해서, {{jsxref("Object.defineProperty()")}}를 사용한다.</p>
+
+<pre class="brush: js">var o = { a:0 };
+
+Object.defineProperty(o, "b", { set: function (x) { this.a = x / 2; } });
+
+o.b = 10; // Runs the setter, which assigns 10 / 2 (5) to the 'a' property
+console.log(o.a) // 5</pre>
+
+<h3 id="연산된(computed)_property_name_사용하기">연산된(computed) property name 사용하기</h3>
+
+<div class="note">
+<p><strong>Note:</strong> 계산된(Computed) properties는 실험적인 기술이고,  ECMAScript 6 proposal의 부분이다. 아직 많은 브라우저가 지원하지 않는다. 이것 때문에 지원하지 않는 환경에서는  문법 오류가 발생할 것이다.</p>
+</div>
+
+<pre class="brush: js">var expr = "foo";
+
+var obj = {
+ baz: "bar",
+ set [expr](v) { this.baz = v; }
+};
+
+console.log(obj.baz); // "bar"
+obj.foo = "baz"; // run the setter
+console.log(obj.baz); // "baz"
+</pre>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-11.1.5', 'Object Initializer')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Added computed property names.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-method-definitions', 'Method definitions')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성CompatibilityTable">브라우저 호환성{{CompatibilityTable}}</h2>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(1)}}</td>
+ <td>{{ CompatGeckoDesktop("1.8.1") }}</td>
+ <td>{{ CompatIE(9) }}</td>
+ <td>9.5</td>
+ <td>3</td>
+ </tr>
+ <tr>
+ <td>Computed property names</td>
+ <td>{{CompatNo}}</td>
+ <td>{{ CompatGeckoDesktop("34") }}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{ CompatGeckoMobile("1.8.1") }}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Computed property names</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{ CompatGeckoMobile("34.0") }}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="SpiderMonkey-specific_notes">SpiderMonkey-specific notes</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/JavaScript/New_in_JavaScript/1.8.1"> JavaScript 1.8.1</a>부터, object와 array initializers에서 properties를 설정 할 때 setter는 더이상 호출되지 않는다.</li>
+ <li>SpiderMonkey 38 부터, {{jsxref("Functions/rest_parameters", "rest parameter", "", 1)}} 를 갖는 setter는  ES6 specification에 따라 {{jsxref("SyntaxError")}}이다.</li>
+</ul>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions/get">getter</a></li>
+ <li>{{jsxref("Operators/delete", "delete")}}</li>
+ <li>{{jsxref("Object.defineProperty()")}}</li>
+ <li>{{jsxref("Object.defineGetter", "__defineGetter__")}}</li>
+ <li>{{jsxref("Object.defineSetter", "__defineSetter__")}}</li>
+ <li><a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">Defining Getters and Setters</a> in JavaScript Guide</li>
+</ul>
diff --git a/files/ko/web/javascript/reference/functions/애로우_펑션/index.html b/files/ko/web/javascript/reference/functions/애로우_펑션/index.html
new file mode 100644
index 0000000000..02dc0d55e4
--- /dev/null
+++ b/files/ko/web/javascript/reference/functions/애로우_펑션/index.html
@@ -0,0 +1,465 @@
+---
+title: 화살표 함수
+slug: Web/JavaScript/Reference/Functions/애로우_펑션
+tags:
+ - ECMAScript6
+ - Functions
+ - Intermediate
+ - JavaScript
+ - Reference
+translation_of: Web/JavaScript/Reference/Functions/Arrow_functions
+---
+<div>{{jsSidebar("Functions")}}</div>
+
+<p>화살표 함수 표현(<strong>arrow function expression</strong>)은 <a href="/ko/docs/Web/JavaScript/Reference/Operators/function" title="function expressions">function 표현</a>에 비해 구문이 짧고  자신의 <a href="/ko/docs/Web/JavaScript/Reference/Operators/this">this</a>, <a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments">arguments</a>, <a href="/ko/docs/Web/JavaScript/Reference/Operators/super">super</a> 또는 <a href="/ko/docs/Web/JavaScript/Reference/Operators/new.target">new.target</a>을 바인딩 하지 않습니다. 화살표 함수는 항상 <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function/name" title="anonymous">익명</a>입니다. 이  함수 표현은 메소드 함수가 아닌 곳에 가장 적합합니다. 그래서 생성자로서 사용할 수 없습니다.</p>
+
+<p>{{EmbedInteractiveExample("pages/js/functions-arrow.html")}}</p>
+
+<h2 id="구문">구문</h2>
+
+<h3 id="기본_구문">기본 구문</h3>
+
+<pre class="syntaxbox notranslate"><strong>(</strong><em>param1</em>, <em>param2</em>, …, <em>paramN</em><strong>) =&gt; {</strong> <em>statements</em> <strong>}</strong>
+<strong>(</strong><em>param1</em>, <em>param2</em>, …, <em>paramN</em><strong>) =&gt;</strong> <em>expression</em>
+// 다음과 동일함: =&gt; { return expression; }
+
+// 매개변수가 하나뿐인 경우 괄호는 선택사항:
+<em>(singleParam)</em> <strong>=&gt; {</strong> <em>statements</em> <strong>}</strong>
+<em>singleParam</em> <strong>=&gt;</strong> { <em>statements }</em>
+
+// 매개변수가 없는 함수는 괄호가 필요:
+<strong>() =&gt; {</strong> <em>statements</em> <strong>}</strong></pre>
+
+<h3 id="고급_구문">고급 구문</h3>
+
+<pre class="syntaxbox notranslate">// 객체 리터럴 표현을 반환하기 위해서는 함수 본문(body)을 괄호 속에 넣음:
+<em>params</em> =&gt; ({<em>foo: bar</em>})
+
+// <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="Rest parameter">나머지 매개변수</a> 및 <a href="/ko/docs/Web/JavaScript/Reference/Functions/Default_parameters" title="Default parameter">기본 매개변수</a>를 지원함
+(<em>param1</em>, <em>param2</em>, <strong>...rest</strong>) =&gt; { <em>statements</em> }
+(<em>param1</em> <strong>= defaultValue1</strong>, <em>param2</em>, …, paramN <strong>= defaultValueN</strong>) =&gt; { <em>statements</em> }
+
+// 매개변수 목록 내 <a href="/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" title="Destructuring">구조분해할당</a>도 지원됨
+var f = ([a, b] = [1, 2], {x: c} = {x: a + b}) =&gt; a + b + c;
+f(); // 6
+</pre>
+
+<p>상세한 구문 예는 <a href="http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax">여기</a>에서 볼 수 있습니다.</p>
+
+<h2 id="설명">설명</h2>
+
+<p><a href="https://hacks.mozilla.org/2015/06/es6-in-depth-arrow-functions/">Hacks 블로그 "ES6 In Depth: Arrow functions" 포스트</a> 참조.</p>
+
+<p>화살표 함수 도입에 영향을 준 두 요소: 보다 짧아진 함수 및  <code>바인딩하지 않은 this.</code></p>
+
+<h3 id="짧은_함수">짧은 함수</h3>
+
+<p>일부 함수 패턴에서는, 짧은 함수가 환영받습니다. 비교해 보세요:</p>
+
+<pre class="notranslate">var elements = [
+ 'Hydrogen',
+ 'Helium',
+ 'Lithium',
+ 'Beryllium'
+];
+
+// 이 문장은 배열을 반환함: [8, 6, 7, 9]
+elements.<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">map</a>(function(element) {
+ return element.length;
+});
+
+// 위의 일반적인 함수 표현은 아래 화살표 함수로 쓸 수 있다.
+elements.map((element) =&gt; {
+  return element.length;
+}); // [8, 6, 7, 9]
+
+// 파라미터가 하나만 있을 때는 주변 괄호를 생략할 수 있다.
+elements.<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">map</a>(element =&gt; {
+ return element.length;
+}); // [8, 6, 7, 9]
+
+// 화살표 함수의 유일한 문장이 'return'일 때 'return'과
+// 중괄호({})를 생략할 수 있다.
+elements.map(element =&gt; element.length); // [8, 6, 7, 9]
+
+// 이 경우 length 속성만 필요하므로 destructuring 매개변수를 사용할 수 있다.
+// 'length'는 우리가 얻고자 하는 속성에 해당하는 반면,
+// lengthFooBArX'는 변경 가능한 변수의 이름일 뿐이므로
+// 원하는 유효한 변수명으로 변경할 수 있다.
+elements.<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">map</a>(({ length: lengthFooBArX }) =&gt; lengthFooBArX); // [8, 6, 7, 9]
+
+// destructuring 파라미터 할당도 아래와 같이 작성할 수 있습니다.
+// 이 예에서 정의한 객체내의 'length'에 값을 지정하지 않은 점에 주목하세요. 대신, "length" 변수의
+// 리터럴 이름은 우리가 해당 객체에서 꺼내오고 싶은 속성이름 자체로 사용됩니다.
+elements.<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">map</a>(({ length }) =&gt; length); // [8, 6, 7, 9] </pre>
+
+<h3 id="바인딩_되지_않은_this">바인딩 되지 않은 <code>this</code></h3>
+
+<p>화살표 함수가 나오기 전까지는, 모든 새로운 함수는, 어떻게 그 함수가 호출되는지에 따라  자신의 <code><a href="/ko/docs/Web/JavaScript/Reference/Operators/this">this</a></code> 값을 정의했습니다:</p>
+
+<ul>
+ <li>이 함수가 생성자인 경우는 새로운 객체</li>
+ <li><a href="/ko/docs/Web/JavaScript/Reference/Strict_mode" title="strict mode">엄격 모드</a> 함수 호출에서는 <code>undefined</code> </li>
+ <li>함수가 "객체 메서드"로서 호출된 경우 문맥 객체</li>
+ <li>등등</li>
+</ul>
+
+<p>이는 객체 지향 스타일로 프로그래밍할 때 별로 좋지않습니다.</p>
+
+<pre class="brush: js notranslate">function Person() {
+ // Person() 생성자는 `this`를 자신의 인스턴스로 정의.
+ this.age = 0;
+
+ setInterval(function growUp() {
+ // 비엄격 모드에서, growUp() 함수는 `this`를
+ // 전역 객체로 정의하고, 이는 Person() 생성자에
+ // 정의된 `this`와 다름.
+ this.age++;
+ }, 1000);
+}
+
+var p = new Person();</pre>
+
+<p>ECMAScript 3/5 에서는, 이 문제를 <code>this</code> 값을 폐쇄될 수 있는 (비전역) 변수에 할당하여 해결했습니다.</p>
+
+<pre class="brush: js notranslate">function Person() {
+ var that = this;
+ that.age = 0;
+
+ setInterval(function growUp() {
+ // 콜백은 `that` 변수를 참조하고 이것은 값이 기대한 객체이다.
+ that.age++;
+ }, 1000);
+}</pre>
+
+<p>이렇게 하는 대신에, <a href="/ko/docs/Web/JavaScript/Reference/Global_Objects/Function/bind" title="bound function">바인딩한 함수</a>는 적절한 <code>this</code> 값이 <code>growUp()</code> 함수에 전달될 수 있도록 생성될 수 있습니다.</p>
+
+<p>화살표 함수는 자신의 <code>this</code>가 없습니다.  대신 화살표 함수를 둘러싸는 렉시컬 범위(lexical scope)의 <code>this</code>가 사용됩니다; 화살표 함수는 일반 변수 조회 규칙(normal variable lookup rules)을 따릅니다. 때문에 현재 범위에서 존재하지 않는 <code>this</code>를 찾을 때, 화살표 함수는 바로 바깥 범위에서 <code>this</code>를 찾는것으로 검색을 끝내게 됩니다.</p>
+
+<p>따라서 다음 코드에서 <code>setInterval</code>에 전달 된 함수 내부의 <code>this</code>는 <code>setInterval</code>을 포함한 function의 <code>this</code>와 동일한 값을 갖습니다.</p>
+
+<pre class="brush: js notranslate">function Person(){
+ this.age = 0;
+
+ setInterval(() =&gt; {
+ this.age++; // |this|는 Person 객체를 참조
+ }, 1000);
+}
+
+var p = new Person();</pre>
+
+<h4 id="엄격_모드와의_관계">엄격 모드와의 관계</h4>
+
+<p><code>this</code>가 렉시컬(lexical, 정적)임을 감안하면, <code>this</code>에 관한 <a href="/ko/docs/Web/JavaScript/Reference/Strict_mode" title="strict mode">엄격 모드</a> 규칙은 그냥 무시됩니다.</p>
+
+<pre class="notranslate">var f = () =&gt; { 'use strict'; return this; };
+f() === window; // 혹은 전역객체</pre>
+
+<p>엄격 모드의 나머지 규칙은 평소대로 적용합니다.</p>
+
+<p><strong>CORRECTION: START</strong></p>
+
+<p>NOTE: the previous statement seems false.</p>
+
+<p>Strict mode should prevent creating global variables when assigning to an undeclared identifier in a function.</p>
+
+<p>This code sample using Chrome 81 demonstrates that arrow functions allow the creation of global variables in such situations (both for a concise body and for a normal function body):</p>
+
+<pre class="notranslate">&gt; f1 = x =&gt; { y = x; console.log(`x: ${x}, y: ${y}`); return x + 1; }
+x =&gt; { y = x; console.log(`x: ${x}, y: ${y}`); return x + 1; }
+
+&gt; y
+VM51587:1 Uncaught ReferenceError: y is not defined
+    at &lt;anonymous&gt;:1:1
+(anonymous) @ VM51587:1
+
+&gt; f1(3)
+VM51533:1 x: 3, y: 3
+4
+
+&gt; y
+3
+
+&gt; f2 = x =&gt; { 'use strict'; z = x; console.log(`x: ${x}, z: ${z}`); return x + 1; }
+x =&gt; { 'use strict'; z = x; console.log(`x: ${x}, z: ${z}`); return x + 1; }
+
+&gt; z
+VM51757:1 Uncaught ReferenceError: z is not defined
+    at &lt;anonymous&gt;:1:1
+(anonymous) @ VM51757:1
+
+&gt; f2(4)
+VM51712:1 Uncaught ReferenceError: z is not defined
+    at f2 (&lt;anonymous&gt;:1:29)
+    at &lt;anonymous&gt;:1:1
+f2 @ VM51712:1
+(anonymous) @ VM51800:1
+
+&gt; f3 = x =&gt; (z1 = x + 1)
+x =&gt; (z1 = x + 1)
+
+&gt; z1
+VM51891:1 Uncaught ReferenceError: z1 is not defined
+    at &lt;anonymous&gt;:1:1
+(anonymous) @ VM51891:1
+
+&gt; f3(10)
+11
+
+&gt; z1
+11
+</pre>
+
+<p>f2 illustrates that when explicitly setting the arrow function to apply strict mode, it does throw an error when attempting to assign an undeclared variable.</p>
+
+<p>https://www.ecma-international.org/ecma-262/10.0/index.html#sec-strict-mode-code</p>
+
+<p>https://www.ecma-international.org/ecma-262/10.0/index.html#sec-arrow-function-definitions-runtime-semantics-evaluation</p>
+
+<p><strong>CORRECTION: END</strong></p>
+
+<h4 id="call_또는_apply를_통한_피호출">call 또는 apply를 통한 피호출</h4>
+
+<p>화살표 함수에서는 <code>this가 </code> 바인딩되지 않았기 때문에, <code>call()</code> 또는 <code>apply()</code> 메서드는  인자만 전달 할 수 있습니다. this는 무시됩니다.</p>
+
+<pre class="brush: js notranslate">var adder = {
+ base : 1,
+
+ add : function(a) {
+ var f = v =&gt; v + this.base;
+ return f(a);
+ },
+
+ addThruCall: function(a) {
+ var f = v =&gt; v + this.base;
+ var b = {
+ base : 2
+ };
+
+ return f.call(b, a);
+ }
+};
+
+console.log(adder.add(1)); // 이는 2가 콘솔에 출력될 것임
+console.log(adder.addThruCall(1)); // 이도 2가 콘솔에 출력될 것임</pre>
+
+<h3 id="바인딩_되지_않은_arguments">바인딩 되지 않은 <code>arguments</code></h3>
+
+<p>화살표 함수는 <a href="/ko/docs/Web/JavaScript/Reference/Functions/arguments"><code>arguments</code> 객체</a>를 바인드 하지 않습니다.  때문에, <code>arguments는</code>  그저 둘러싸는 범위(scope) 내 이름에 대한 참조입니다.</p>
+
+<pre class="brush: js notranslate"><code>var arguments = [1, 2, 3];
+var arr = () =&gt; arguments[0];
+
+arr(); // 1
+
+function foo(n) {
+ var f = () =&gt; arguments[0] + n; // foo's implicit arguments binding. arguments[0] is n
+ return f();
+}
+
+foo(1); // 2</code></pre>
+
+<p>화살표 함수는 자신의 <code>arguments</code> 객체가 없지만, 대부분의 경우에 <a href="/ko/docs/Web/JavaScript/Reference/Functions/rest_parameters" title="rest parameters">나머지 매개변수</a>가 좋은 대안입니다:</p>
+
+<pre class="brush: js notranslate">function foo(n) {
+ var f = (...args) =&gt; args[0] + n;
+ return f(2);
+}
+
+foo(1); // 3</pre>
+
+<h3 id="메소드로_사용되는_화살표_함수">메소드로 사용되는 화살표 함수</h3>
+
+<p>이야기 했듯이, 화살표 함수 표현은 메소드 함수가 아닌 형태로 사용 할 수 있습니다. 메소드로 사용하려고 한면 무슨일이 발생하는지 봅시다.</p>
+
+<pre class="brush: js notranslate"><code>'use strict';
+
+var obj = { // does not create a new scope
+ i: 10,
+ b: () =&gt; console.log(this.i, this),
+ c: function() {
+ console.log( this.i, this)
+ }
+}
+obj.b(); // prints undefined, Window {...} (or the global object)
+obj.c(); // prints 10, Object {...}</code>
+</pre>
+
+<p>화살표 함수는 자신의 this를 가지고("bind" 바인드)있지 않습니다.{{jsxref("Object.defineProperty()")}}</p>
+
+<pre class="brush: js notranslate"><code>'use strict';
+
+var obj = {
+ a: 10
+};
+
+Object.defineProperty(obj, 'b', {
+ get: () =&gt; {
+ console.log(this.a, typeof this.a, this); // undefined 'undefined' Window {...} (or the global object)
+ return this.a + 10; // represents global object 'Window', therefore 'this.a' returns 'undefined'
+ }
+});</code></pre>
+
+<h3 id="new_연산자_사용"><code>new</code> 연산자 사용</h3>
+
+<p>화살표 함수는 생성자로서 사용될 수 없으며 <code>new</code>와 함께 사용하면 오류가 발생합니다.</p>
+
+<pre class="brush: js notranslate"><code>var Foo = () =&gt; {};
+var foo = new Foo(); // TypeError: Foo is not a constructor</code></pre>
+
+<h3 id="prototype_속성_사용"><code>prototype</code> 속성 사용</h3>
+
+<p>화살표 함수는 <code>prototype</code> 속성이 없습니다.</p>
+
+<pre class="brush: js notranslate"><code>var Foo = () =&gt; {};
+console.log(Foo.prototype); // undefined</code></pre>
+
+<h3 id="yield_키워드_사용"><code>yield</code> 키워드 사용</h3>
+
+<p><code><a href="/ko/docs/Web/JavaScript/Reference/Operators/yield">yield</a></code> 키워드는 화살표 함수의 본문(그 안에 더 중첩된 함수 내에서 허용한 경우를 제외하고)에 사용될 수 없습니다. 그 결과, 화살표 함수는 생성기(generator)로서 사용될 수 없습니다.</p>
+
+<h3 id="함수_본문">함수 본문</h3>
+
+<p>화살표 함수는 "concise 바디"든 보통 "block 바디"든 하나를 가질 수 있습니다.</p>
+
+<div class="note">
+<p>concise바디는 중괄호'{}'로 묶이지않은 한줄짜리 바디이고 block바디는 중괄호로 묶인 바디입니다. 보통 여러줄 쓸때 block바디를 사용합니다.</p>
+</div>
+
+<p>block바디는 자동으로 값을 반환하지 않습니다. <code>return</code>을 사용해서 값을 반환해야 합니다.</p>
+
+<pre class="brush: js notranslate">var func = x =&gt; x * x; // concise 바디, 생략된 "return" 여기서는 x * x
+var func = (x, y) =&gt; { return x + y; }; // block 바디, "return"이 필요
+</pre>
+
+<h3 id="객체_리터럴_반환">객체 리터럴 반환</h3>
+
+<p>간결한 구문 <code>params =&gt; {object:literal}</code>을 사용한 객체 리터럴 반환은 예상대로 작동하지 않음을 명심하세요:</p>
+
+<pre class="brush: js notranslate">var func = () =&gt; {  foo: 1  };
+// func() 호출은 undefined를 반환!
+
+var func = () =&gt; {  foo: function() {}  };
+// SyntaxError: function 문은 이름이 필요함</pre>
+
+<p>이는 중괄호({}) 안 코드가 일련의 문(즉 <code>foo</code>는 라벨처럼 취급됩니다, 객체 리터럴 내 키가 아니라)으로 파싱(parse, 구문 분석)되기 때문입니다.</p>
+
+<p>객체 리터럴를 괄호로 감싸는 것을 기억하세요:</p>
+
+<pre class="brush: js notranslate">var func = () =&gt; ({ foo: 1 });</pre>
+
+<h3 id="줄바꿈">줄바꿈</h3>
+
+<p>화살표 함수는 파라메터와 화살표 사이에 개행 문자를 포함 할 수 없습니다.</p>
+
+<pre class="brush: js notranslate"><code>var func = (a, b, c)
+ =&gt; 1;
+// SyntaxError: expected expression, got '=&gt;'</code></pre>
+
+<p>하지만, 보기 좋은 코드를 유지하고 싶다면, 아래에 보는 것처럼 괄호나 개행을 둠으로써 이를 수정할 수 있습니다.</p>
+
+<pre class="notranslate">var func = (a, b, c) =&gt;
+  1;
+
+var func = (a, b, c) =&gt; (
+  1
+);
+
+var func = (a, b, c) =&gt; {
+  return 1
+};
+
+<code>var func = (
+ a,
+ b,
+ c
+) =&gt; 1;
+
+// SyntaxError가 발생하지 않습니다.</code></pre>
+
+<h3 id="파싱순서">파싱순서</h3>
+
+<p>화살표 함수 내의 화살표는 연산자가 아닙니다. 그러나 화살표 함수는 평범한 함수와 비교했을 때 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">operator precedence</a>와 다르게 반응하는 특별한 파싱룰을 가지고 있습니다.</p>
+
+<pre class="brush: js notranslate"><code>let callback;
+
+callback = callback || function() {}; // ok
+
+callback = callback || () =&gt; {};
+// SyntaxError: invalid arrow-function arguments
+
+callback = callback || (() =&gt; {}); // ok</code>
+</pre>
+
+<h2 id="다른_예">다른 예</h2>
+
+<h3 id="기본_사용법">기본 사용법</h3>
+
+<pre class="brush: js notranslate"><code>// </code> empty 화살표 함수는 undefined를 반환 <code>
+let empty = () =&gt; {};
+
+(() =&gt; 'foobar')();
+// "foobar" 반환
+// (this is an Immediately Invoked Function Expression
+
+var simple = a =&gt; a &gt; 15 ? 15 : a;
+simple(16); // 15
+simple(10); // 10
+
+let max = (a, b) =&gt; a &gt; b ? a : b;
+
+// Easy array filtering, mapping, ...
+
+var arr = [5, 6, 13, 0, 1, 18, 23];
+
+var sum = arr.reduce((a, b) =&gt; a + b);
+// 66
+
+var even = arr.filter(v =&gt; v % 2 == 0);
+// [6, 0, 18]
+
+var double = arr.map(v =&gt; v * 2);
+// [10, 12, 26, 0, 2, 36, 46]
+
+// 더 간결한 promise 체인
+promise.then(a =&gt; {
+ // ...
+}).then(b =&gt; {
+ // ...
+});
+
+// 매개변수가 없는 경우에도 더 읽기 쉬움
+setTimeout( () =&gt; {
+ console.log('I happen sooner');
+ setTimeout( () =&gt; {
+ // deeper code
+ console.log('I happen later');
+ }, 1);
+}, 1);</code></pre>
+
+<h2 id="스펙">스펙</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-arrow-function-definitions', 'Arrow Function Definitions')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<div class="hidden">
+<p><span style="">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out </span><a href="https://github.com/mdn/browser-compat-data" style="">https://github.com/mdn/browser-compat-data</a><span style=""> and send us a pull request.</span></p>
+</div>
+
+<p>{{Compat("javascript.functions.arrow_functions")}}</p>
+
+<h2 id="참조">참조</h2>
+
+<ul>
+ <li><a href="https://hacks.mozilla.org/2015/06/es6-in-depth-arrow-functions/">Hacks 블로그 "ES6 In Depth: Arrow functions" 포스트</a></li>
+</ul>