diff options
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/object')
9 files changed, 33 insertions, 34 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/object/assign/index.html b/files/ko/web/javascript/reference/global_objects/object/assign/index.html index 71f17c01b9..d5cadcce66 100644 --- a/files/ko/web/javascript/reference/global_objects/object/assign/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/assign/index.html @@ -11,8 +11,8 @@ tags: - 객체 - 레퍼런스 - 메소드 -translation_of: Web/JavaScript/Reference/Global_Objects/Object/assign browser-compat: javascript.builtins.Object.assign +translation_of: Web/JavaScript/Reference/Global_Objects/Object/assign --- <div>{{JSRef}}</div> @@ -99,7 +99,7 @@ const copy = Object.assign({}, obj); console.log(copy); // { a: 1 } </pre> -<h3 id="Deep_Clone" name="Deep_Clone">깊은 복사에 대한 주의사항</h3> +<h3 id="Deep_Clone">깊은 복사에 대한 주의사항</h3> <p>깊은 복사를 위해서는, 다른 방법을 사용해야 합니다. 왜냐하면 <code>Object.assign()</code> 은 속성 값을 복사하기 때문입니다.</p> diff --git a/files/ko/web/javascript/reference/global_objects/object/constructor/index.html b/files/ko/web/javascript/reference/global_objects/object/constructor/index.html index 0162140d9c..b4662df8be 100644 --- a/files/ko/web/javascript/reference/global_objects/object/constructor/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/constructor/index.html @@ -7,6 +7,7 @@ tags: - Property - Prototype - Reference +browser-compat: javascript.builtins.Object.constructor translation_of: Web/JavaScript/Reference/Global_Objects/Object/constructor --- <div>{{JSRef}}</div> @@ -150,6 +151,4 @@ function String() { <h2 id="브라우저_호환성">브라우저 호환성</h2> -<div>{{Compat("javascript.builtins.Object.constructor")}}</div> - -<div id="compat-mobile"> </div> +<div>{{Compat}}</div> diff --git a/files/ko/web/javascript/reference/global_objects/object/create/index.html b/files/ko/web/javascript/reference/global_objects/object/create/index.html index 1d8873600c..730ecbbdf0 100644 --- a/files/ko/web/javascript/reference/global_objects/object/create/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/create/index.html @@ -88,7 +88,7 @@ MyClass.prototype.myMethod = function() { <p><code>mixin</code> 함수는 상위(super)클래스 프로토타입에서 하위(sub)클래스 프로토타입으로 함수를 복사하고, mixin 함수는 사용자에 의해 공급될 필요가 있습니다. mixin 같은 함수의 예는 <a href="https://api.jquery.com/jQuery.extend/">jQuery.extend()</a>입니다.</p> -<h3 id="Object.create()와_함께_propertiesObject_인수_사용하기"><code>Object.create()<font face="Open Sans, Arial, sans-serif">와 함께 </font></code><code>propertiesObject</code> 인수 사용하기</h3> +<h3 id="Object.create()와_함께_propertiesObject_인수_사용하기"><code>Object.create()</code>와 함께 <code>propertiesObject</code> 인수 사용하기</h3> <pre class="brush: js">var o; diff --git a/files/ko/web/javascript/reference/global_objects/object/defineproperty/index.html b/files/ko/web/javascript/reference/global_objects/object/defineproperty/index.html index 0d4a803316..bf3dabffdd 100644 --- a/files/ko/web/javascript/reference/global_objects/object/defineproperty/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/defineproperty/index.html @@ -42,9 +42,9 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/defineProperty <h2 id="설명">설명</h2> -<p><code>defineProperty</code>는 객체의 속성을 정교하게 추가하거나 수정할 수 있습니다. 할당을 통해 속성을 추가하는 일반적인 방법을 사용하면 속성 열거<sup>enumeration</sup>({{jsxref("Statements/for...in", "for...in")}} 반복문이나 {{jsxref("Object.keys")}} 메서드)를 통해 노출되어 값을 변경하거나 {{jsxref("Operators/delete", "delete")}} 연산자로 삭제할 수 있습니다. <code>defineProperty</code>를 사용하면 이런 부분을 상세하게 조절할 수 있습니다. <code>Object.defineProperty()</code>로 추가한 속성은 기본적으로 불변합니다.</p> +<p><code>defineProperty</code>는 객체의 속성을 정교하게 추가하거나 수정할 수 있습니다. 할당을 통해 속성을 추가하는 일반적인 방법을 사용하면 속성 열거({{jsxref("Statements/for...in", "for...in")}} 반복문이나 {{jsxref("Object.keys")}} 메서드)를 통해 노출되어 값을 변경하거나 {{jsxref("Operators/delete", "delete")}} 연산자로 삭제할 수 있습니다. <code>defineProperty</code>를 사용하면 이런 부분을 상세하게 조절할 수 있습니다. <code>Object.defineProperty()</code>로 추가한 속성은 기본적으로 불변합니다.</p> -<p>속성 서술자<sup>property descriptors</sup>는 객체로 나타내며 데이터 서술자<sup>data descriptors</sup>와 접근자 서술자<sup>accessor descriptors</sup>의 두 가지 유형을 갖습니다. 데이터 서술자는 값을 가지는 속성으로, 덮어쓰거나 쓸 수 없습니다. 접근자 서술자는 접근자<sup>getter</sup>-설정자<sup>setter</sup> 한 쌍을 가지는 속성입니다. 서술자는 두 유형 중 하나여야 하며, 동시에 두 유형일 수는 없습니다.</p> +<p>속성 서술자는 객체로 나타내며 데이터 서술자(data descriptors)와 접근자 서술자(accessor descriptors)의 두 가지 유형을 갖습니다. 데이터 서술자는 값을 가지는 속성으로, 덮어쓰거나 쓸 수 없습니다. 접근자 서술자는 접근자(getter)-설정자(setter) 한 쌍을 가지는 속성입니다. 서술자는 두 유형 중 하나여야 하며, 동시에 두 유형일 수는 없습니다.</p> <p>데이터 서술자와 접근자 서술자 모두 객체이며 다음과 같은 키를 공유합니다.</p> @@ -286,7 +286,7 @@ delete o.a; // Nothing happens console.log(o.a); // logs 1 </pre> -<p><font face="Courier New">o.a</font>의 <font face="Courier New">configurable</font> 가 <font face="Courier New">true</font>라면, 위의 예외는 발생하지 않고 속성은 마지막에 제거되었을 것이다.</p> +<p>o.a의 configurable 가 true라면, 위의 예외는 발생하지 않고 속성은 마지막에 제거되었을 것이다.</p> <h3 id="속성에_기본값_추가하기">속성에 기본값 추가하기</h3> diff --git a/files/ko/web/javascript/reference/global_objects/object/freeze/index.html b/files/ko/web/javascript/reference/global_objects/object/freeze/index.html index 6eaca7b708..aa92c7f488 100644 --- a/files/ko/web/javascript/reference/global_objects/object/freeze/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/freeze/index.html @@ -23,11 +23,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze -<h2 id="Syntax" name="Syntax">구문</h2> +<h2 id="Syntax">구문</h2> <pre class="syntaxbox">Object.freeze(<var>obj</var>)</pre> -<h3 id="Parameters" name="Parameters">매개변수</h3> +<h3 id="Parameters">매개변수</h3> <dl> <dt><code>obj</code></dt> @@ -38,7 +38,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze <p>함수로 전달된 객체.</p> -<h2 id="Description" name="Description">설명</h2> +<h2 id="Description">설명</h2> <p>동결 객체의 속성 집합에는 어떠한 것도 추가하거나 제거할 수 없으며, 그리 하려는 모든 시도는 조용히 넘어가거나, {{jsxref("TypeError")}} 예외가 발생하며 실패합니다. 예외 발생은 보통 {{jsxref("Strict_mode", "엄격 모드", "", 1)}}인 경우 발생하지만, 반드시 엄격 모드로만 제한되는 것은 아닙니다.</p> @@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze <p><code>freeze()</code>는 함수에 전달한 객체를 그대로 반환하며, 동결된 객체 사본을 생성하는 것이 아닙니다.</p> -<h2 id="Examples" name="Examples">예제</h2> +<h2 id="Examples">예제</h2> <h3 id="객체_동결하기">객체 동결하기</h3> @@ -181,7 +181,7 @@ obj2.internal.a = 'anotherValue'; // 비엄격 모드에서 조용하게 실패 obj2.internal.a; // null </pre> -<h2 id="Notes" name="Notes">사용 노트</h2> +<h2 id="Notes">사용 노트</h2> <p>ES5에서는, 이 메소드에 대한 인자가 객체(원시형)가 아닐 경우, {{jsxref("TypeError")}}가 발생합니다. ES2015에서는, 비객체 인자가 동결된 평범한 객체인것처럼 다루어져 반환됩니다.</p> diff --git a/files/ko/web/javascript/reference/global_objects/object/index.html b/files/ko/web/javascript/reference/global_objects/object/index.html index ce7e6c6603..d76739238f 100644 --- a/files/ko/web/javascript/reference/global_objects/object/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/index.html @@ -93,7 +93,7 @@ new Object([<var>value</var>])</pre> <dd>주어진 객체의 열거가능한 모든 스트링 속성들의 값들을 포함하고 있는 배열을 반환합니다.</dd> </dl> -<h2 id="Object_instances" name="Object_instances"><code>Object</code> 인스턴스와 <code>Object</code> 프로토타입 객체</h2> +<h2 id="Object_instances"><code>Object</code> 인스턴스와 <code>Object</code> 프로토타입 객체</h2> <p>JavaScript에서 모든 객체들은 <code>Object</code>의 자손입니다. 모든 객체는 {{jsxref("Object.prototype")}}으로부터 메서드와 속성을 상속하는데, 나중에 덮어 쓸 수도 있습니다. 예를 들어, 다른 생성자의 프로토타입은 그 <code>constructor</code> 속성을 덮어쓰고 자신의 <code>toString()</code> 메소드들을 제공합니다. <code>Object</code> 프로토타입 객체에 대한 변경 내용은 그 변경 내용에 영향을 받는 속성들과 메소드들이 프로토타입 체인(chain)을 따라 더이상 무시되지 않는한, 모든 객체들로 전달됩니다.</p> @@ -105,9 +105,9 @@ new Object([<var>value</var>])</pre> <div>{{page('/ko/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype', '메서드') }}</div> -<h2 id="Examples" name="Examples">예제</h2> +<h2 id="Examples">예제</h2> -<h3 id="Example.3A_Using_Object_given_undefined_and_null_types" name="Example.3A_Using_Object_given_undefined_and_null_types"><code>undefined</code>와 <code>null</code>을 지정</h3> +<h3 id="Example.3A_Using_Object_given_undefined_and_null_types"><code>undefined</code>와 <code>null</code>을 지정</h3> <p>다음 예제는 변수 <code>o</code>에 빈 <code>Object</code> 객체를 저장합니다.</p> @@ -170,7 +170,7 @@ var o = new Object(Boolean()); <p>{{Compat("javascript.builtins.Object")}}</p> -<h2 id="See_also" name="See_also">같이 보기</h2> +<h2 id="See_also">같이 보기</h2> <ul> <li><a href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Object_initializer">Object initializer</a></li> diff --git a/files/ko/web/javascript/reference/global_objects/object/isprototypeof/index.html b/files/ko/web/javascript/reference/global_objects/object/isprototypeof/index.html index 0e9de96b41..b2cefcdb65 100644 --- a/files/ko/web/javascript/reference/global_objects/object/isprototypeof/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/isprototypeof/index.html @@ -17,18 +17,18 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf <p><strong>Note:</strong> <code>isPrototypeOf</code> 는 {{jsxref("Operators/instanceof", "instanceof")}} 연산자와 다릅니다. "<code>object instanceof AFunction</code>"표현식에서는 <code>object</code>의 프로토타입 체인을 AFunction 자체가 아니라 <code>AFunction.prototype에 대해 </code>확인을 합니다.</p> </div> -<h2 id="Syntax" name="Syntax">구문</h2> +<h2 id="Syntax">구문</h2> <pre class="syntaxbox"><var>prototypeObj</var>.isPrototypeOf(<var>obj</var>)</pre> -<h3 id="Parameters" name="Parameters">매개변수</h3> +<h3 id="Parameters">매개변수</h3> <dl> <dt><code>object</code></dt> <dd>프로토타입 체인을 가지고 있는 객체가 검색될 것 입니다.</dd> </dl> -<h2 id="Description" name="Description">설명</h2> +<h2 id="Description">설명</h2> <p><code>isPrototypeOf</code> 메소드는 또 다른 객체의 프로토타입 체인에 해당 객체가 존재하는지 여부를 확인할수 있습니다.</p> @@ -99,13 +99,13 @@ if (Fi.prototype.isPrototypeOf(fum)) { <p>{{Compat("javascript.builtins.Object.isPrototypeOf")}}</p> -<h2 id="See_also" name="See_also">같이 보기</h2> +<h2 id="See_also">같이 보기</h2> <ul> <li>{{jsxref("Operators/instanceof", "instanceof")}}</li> <li>{{jsxref("Object.getPrototypeOf()")}}</li> <li> - <div><span style="font-size: 14px; line-height: 1.5;">{{jsxref("Object.setPrototypeOf()")}}</span></div> + <div>{{jsxref("Object.setPrototypeOf()")}}</div> </li> <li>{{jsxref("Object.prototype.__proto__")}} </li> </ul> diff --git a/files/ko/web/javascript/reference/global_objects/object/seal/index.html b/files/ko/web/javascript/reference/global_objects/object/seal/index.html index c04ca07dde..50bd0d7e08 100644 --- a/files/ko/web/javascript/reference/global_objects/object/seal/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/seal/index.html @@ -18,11 +18,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/seal -<h2 id="Syntax" name="Syntax">구문</h2> +<h2 id="Syntax">구문</h2> <pre class="syntaxbox">Object.seal(<var>obj</var>)</pre> -<h3 id="Parameters" name="Parameters">매개변수</h3> +<h3 id="Parameters">매개변수</h3> <dl> <dt><code>obj</code></dt> @@ -33,13 +33,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/seal <p>봉인한 객체.</p> -<h2 id="Description" name="Description">설명</h2> +<h2 id="Description">설명</h2> -<p>객체는 기본적으로 확장이 가능(<span style="line-height: 16.7999992370605px;">{{jsxref("Object.isExtensible()", "extensible", "", 1)}}</span>)합니다. 즉, 새로운 속성을 추가할 수 있습니다. 하지만 객체를 밀봉하면 그 객체에 새로운 속성을 추가할 수 없게되고, 그 객체 내에 존재하는 모든 속성이 설정 불가능(non-configurable)해 집니다. 객체를 밀봉하면 객체의 속성을 고정된 불변의 상태로 만듭니다. 모든 속성을 설정 불가능한 상태로 만드는 것은 데이터 속성(data properties)을 접근자 속성(accessor properties)으로, 또는 접근자 속성을 데이터 속성으로 변경할 수 없게 만듭니다. 하지만 객체를 완전히 얼려서 데이터 속성의 값도 변경할 수 없게 만드는 <code>Object.freeze()</code>와 달리, <code><strong>Object.seal()</strong></code>은 객체를 밀봉한 후에도 그 객체의 데이터 속성의 값은 여전히 변경할 수 있게 해줍니다. 다만, 밀봉한 후에는 객체를 얼리는 것과 마찬가지로 속성의 추가/삭제나 데이터 속성과 접근자 속성 사이의 전환은 암묵적이든, 아니면 <span style="line-height: 16.7999992370605px;">{{jsxref("Strict_mode", "strict mode", "", 1)}} 에서와 같이 명시적으로 {{jsxref("Global_Objects/TypeError", "TypeError")}} 예외를 발생시키든 모두 실패로 끝납니다.</span></p> +<p>객체는 기본적으로 확장이 가능({{jsxref("Object.isExtensible()", "extensible", "", 1)}})합니다. 즉, 새로운 속성을 추가할 수 있습니다. 하지만 객체를 밀봉하면 그 객체에 새로운 속성을 추가할 수 없게되고, 그 객체 내에 존재하는 모든 속성이 설정 불가능(non-configurable)해 집니다. 객체를 밀봉하면 객체의 속성을 고정된 불변의 상태로 만듭니다. 모든 속성을 설정 불가능한 상태로 만드는 것은 데이터 속성(data properties)을 접근자 속성(accessor properties)으로, 또는 접근자 속성을 데이터 속성으로 변경할 수 없게 만듭니다. 하지만 객체를 완전히 얼려서 데이터 속성의 값도 변경할 수 없게 만드는 <code>Object.freeze()</code>와 달리, <code>Object.seal()</code>은 객체를 밀봉한 후에도 그 객체의 데이터 속성의 값은 여전히 변경할 수 있게 해줍니다. 다만, 밀봉한 후에는 객체를 얼리는 것과 마찬가지로 속성의 추가/삭제나 데이터 속성과 접근자 속성 사이의 전환은 암묵적이든, 아니면 {{jsxref("Strict_mode", "strict mode", "", 1)}} 에서와 같이 명시적으로 {{jsxref("Global_Objects/TypeError", "TypeError")}} 예외를 발생시키든 모두 실패로 끝납니다.</p> -<p>프로토타입 체인은 밀봉 전이나 후나 달라지지 않습니다. 하지만 <span style="line-height: 16.7999992370605px;">{{jsxref("Object.proto", "__proto__")}} {{deprecated_inline}} 속성은 함께 밀봉됩니다.</span></p> +<p>프로토타입 체인은 밀봉 전이나 후나 달라지지 않습니다. 하지만 {{jsxref("Object.proto", "__proto__")}} {{deprecated_inline}} 속성은 함께 밀봉됩니다.</p> -<h2 id="Examples" name="Examples">예제</h2> +<h2 id="Examples">예제</h2> <pre class="brush: js">var obj = { prop: function() {}, @@ -80,9 +80,9 @@ Object.defineProperty(obj, 'ohai', { value: 17 }); // TypeErorr 발생 Object.defineProperty(obj, 'foo', { value: 'eit' }); // 속성값의 변경은 가능함 </pre> -<h2 id="Notes" name="Notes">참고</h2> +<h2 id="Notes">참고</h2> -<p>ES5에서는 <code><strong>Object.seal()</strong></code> 메서드의 인자가 객체가 아닐 때(즉, 원시형일 때)는 <span style="line-height: 16.7999992370605px;">{{jsxref("Global_Objects/TypeError", "TypeError")}}가 발생합니다. ES6에서는 원시형 인자도 밀봉된 객체라고 취급해서 {{jsxref("Global_Objects/TypeError", "TypeError")}}를 발생시키지 않고 원시형 인자를 그대로 반환합니다.</span></p> +<p>ES5에서는 <code><strong>Object.seal()</strong></code> 메서드의 인자가 객체가 아닐 때(즉, 원시형일 때)는 {{jsxref("Global_Objects/TypeError", "TypeError")}}가 발생합니다. ES6에서는 원시형 인자도 밀봉된 객체라고 취급해서 {{jsxref("Global_Objects/TypeError", "TypeError")}}를 발생시키지 않고 원시형 인자를 그대로 반환합니다.</p> <pre class="brush: js">> Object.seal(1) TypeError: 1 is not an object // ES5 code @@ -124,7 +124,7 @@ TypeError: 1 is not an object // ES5 code <p>{{Compat("javascript.builtins.Object.seal")}}</p> -<h2 id="See_also" name="See_also">같이 보기</h2> +<h2 id="See_also">같이 보기</h2> <ul> <li>{{jsxref("Object.isSealed()")}}</li> diff --git a/files/ko/web/javascript/reference/global_objects/object/valueof/index.html b/files/ko/web/javascript/reference/global_objects/object/valueof/index.html index 863ba06a1e..cb8e14c16d 100644 --- a/files/ko/web/javascript/reference/global_objects/object/valueof/index.html +++ b/files/ko/web/javascript/reference/global_objects/object/valueof/index.html @@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/valueOf <p>JavaScript는 객체를 원시 값으로 변환할 때 <code>valueOf</code> 메서드를 호출합니다. 보통 원시 값을 필요로 할 때 알아서 사용하므로 직접 호출해야 하는 경우는 매우 드뭅니다.</p> -<p>기본적으로 {{jsxref("Object")}}의 모든 후손 객체는 <code>valueOf</code>를 상속받습니다. 내장된 핵심 객체는 모두 <code>valueOf</code>를 재정의<sup>override</sup>해 적합한 값을 반환합니다. 어떤 객체가 원시 값을 가지고 있지 않다면, <code>valueOf</code>는 객체 스스로를 반환합니다.</p> +<p>기본적으로 {{jsxref("Object")}}의 모든 후손 객체는 <code>valueOf</code>를 상속받습니다. 내장된 핵심 객체는 모두 <code>valueOf</code>를 재정의해 적합한 값을 반환합니다. 어떤 객체가 원시 값을 가지고 있지 않다면, <code>valueOf</code>는 객체 스스로를 반환합니다.</p> <p>여러분의 코드에서 <code>valueOf</code>를 호출해 내장 객체를 원시 값으로 변환할 수 있습니다. 사용자 정의 객체를 만들 땐 <code>valueOf</code>를 재정의해 {{jsxref("Object")}}의 메서드 대신 다른 행동을 부여할 수도 있습니다.</p> @@ -70,7 +70,7 @@ MyNumberType.prototype.valueOf = function() { var myObj = new MyNumberType(4); myObj + 3; // 7</pre> -<h3 id="단항_더하기_사용하기"><a name="Details_of_unary_plus">단항 더하기 사용하기</a></h3> +<h3 id="단항_더하기_사용하기">단항 더하기 사용하기</h3> <pre class="notranslate">+"5" // 5 (string to number) +"" // 0 (string to number) |