From 86792571ae1a21a1e4bf526747d6dd1c2636d167 Mon Sep 17 00:00:00 2001 From: alattalatta Date: Sat, 14 Aug 2021 15:57:42 +0900 Subject: Clean up JS reference documents (#1818) * Clean up JavaScript references HTML code - Remove inline styles - Remove elements - Remove title attribute * Remove sup/sub from JavaScript reference * Remove name attrs from JavaScript reference * Remove legacy browser compat elements * Remove duplicate browser-compat key --- .../reference/global_objects/object/assign/index.html | 4 ++-- .../global_objects/object/constructor/index.html | 5 ++--- .../reference/global_objects/object/create/index.html | 2 +- .../global_objects/object/defineproperty/index.html | 6 +++--- .../reference/global_objects/object/freeze/index.html | 10 +++++----- .../reference/global_objects/object/index.html | 8 ++++---- .../global_objects/object/isprototypeof/index.html | 10 +++++----- .../reference/global_objects/object/seal/index.html | 18 +++++++++--------- .../reference/global_objects/object/valueof/index.html | 4 ++-- 9 files changed, 33 insertions(+), 34 deletions(-) (limited to 'files/ko/web/javascript/reference/global_objects/object') 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 ---
{{JSRef}}
@@ -99,7 +99,7 @@ const copy = Object.assign({}, obj); console.log(copy); // { a: 1 } -

깊은 복사에 대한 주의사항

+

깊은 복사에 대한 주의사항

깊은 복사를 위해서는, 다른 방법을 사용해야 합니다. 왜냐하면 Object.assign() 은 속성 값을 복사하기 때문입니다.

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 ---
{{JSRef}}
@@ -150,6 +151,4 @@ function String() {

브라우저 호환성

-
{{Compat("javascript.builtins.Object.constructor")}}
- -
 
+
{{Compat}}
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() {

mixin 함수는 상위(super)클래스 프로토타입에서 하위(sub)클래스 프로토타입으로 함수를 복사하고, mixin 함수는 사용자에 의해 공급될 필요가 있습니다. mixin 같은 함수의 예는 jQuery.extend()입니다.

-

Object.create()와 함께 propertiesObject 인수 사용하기

+

Object.create()와 함께 propertiesObject 인수 사용하기

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
 
 

설명

-

defineProperty는 객체의 속성을 정교하게 추가하거나 수정할 수 있습니다. 할당을 통해 속성을 추가하는 일반적인 방법을 사용하면 속성 열거enumeration({{jsxref("Statements/for...in", "for...in")}} 반복문이나 {{jsxref("Object.keys")}} 메서드)를 통해 노출되어 값을 변경하거나 {{jsxref("Operators/delete", "delete")}} 연산자로 삭제할 수 있습니다. defineProperty를 사용하면 이런 부분을 상세하게 조절할 수 있습니다. Object.defineProperty()로 추가한 속성은 기본적으로 불변합니다.

+

defineProperty는 객체의 속성을 정교하게 추가하거나 수정할 수 있습니다. 할당을 통해 속성을 추가하는 일반적인 방법을 사용하면 속성 열거({{jsxref("Statements/for...in", "for...in")}} 반복문이나 {{jsxref("Object.keys")}} 메서드)를 통해 노출되어 값을 변경하거나 {{jsxref("Operators/delete", "delete")}} 연산자로 삭제할 수 있습니다. defineProperty를 사용하면 이런 부분을 상세하게 조절할 수 있습니다. Object.defineProperty()로 추가한 속성은 기본적으로 불변합니다.

-

속성 서술자property descriptors는 객체로 나타내며 데이터 서술자data descriptors와 접근자 서술자accessor descriptors의 두 가지 유형을 갖습니다. 데이터 서술자는 값을 가지는 속성으로, 덮어쓰거나 쓸 수 없습니다. 접근자 서술자는 접근자getter-설정자setter 한 쌍을 가지는 속성입니다. 서술자는 두 유형 중 하나여야 하며, 동시에 두 유형일 수는 없습니다.

+

속성 서술자는 객체로 나타내며 데이터 서술자(data descriptors)와 접근자 서술자(accessor descriptors)의 두 가지 유형을 갖습니다. 데이터 서술자는 값을 가지는 속성으로, 덮어쓰거나 쓸 수 없습니다. 접근자 서술자는 접근자(getter)-설정자(setter) 한 쌍을 가지는 속성입니다. 서술자는 두 유형 중 하나여야 하며, 동시에 두 유형일 수는 없습니다.

데이터 서술자와 접근자 서술자 모두 객체이며 다음과 같은 키를 공유합니다.

@@ -286,7 +286,7 @@ delete o.a; // Nothing happens console.log(o.a); // logs 1
-

o.aconfigurabletrue라면, 위의 예외는 발생하지 않고 속성은 마지막에 제거되었을 것이다.

+

o.a의 configurable 가 true라면, 위의 예외는 발생하지 않고 속성은 마지막에 제거되었을 것이다.

속성에 기본값 추가하기

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 -

구문

+

구문

Object.freeze(obj)
-

매개변수

+

매개변수

obj
@@ -38,7 +38,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze

함수로 전달된 객체.

-

설명

+

설명

동결 객체의 속성 집합에는 어떠한 것도 추가하거나 제거할 수 없으며, 그리 하려는 모든 시도는 조용히 넘어가거나, {{jsxref("TypeError")}} 예외가 발생하며 실패합니다. 예외 발생은 보통 {{jsxref("Strict_mode", "엄격 모드", "", 1)}}인 경우 발생하지만, 반드시 엄격 모드로만 제한되는 것은 아닙니다.

@@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/freeze

freeze()는 함수에 전달한 객체를 그대로 반환하며, 동결된 객체 사본을 생성하는 것이 아닙니다.

-

예제

+

예제

객체 동결하기

@@ -181,7 +181,7 @@ obj2.internal.a = 'anotherValue'; // 비엄격 모드에서 조용하게 실패 obj2.internal.a; // null -

사용 노트

+

사용 노트

ES5에서는, 이 메소드에 대한 인자가 객체(원시형)가 아닐 경우, {{jsxref("TypeError")}}가 발생합니다. ES2015에서는, 비객체 인자가 동결된 평범한 객체인것처럼 다루어져 반환됩니다.

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([value])
주어진 객체의 열거가능한 모든 스트링 속성들의 값들을 포함하고 있는 배열을 반환합니다.
-

Object 인스턴스와 Object 프로토타입 객체

+

Object 인스턴스와 Object 프로토타입 객체

JavaScript에서 모든 객체들은 Object의 자손입니다. 모든 객체는 {{jsxref("Object.prototype")}}으로부터 메서드와 속성을 상속하는데, 나중에 덮어 쓸 수도 있습니다. 예를 들어, 다른 생성자의 프로토타입은 그 constructor 속성을 덮어쓰고 자신의 toString() 메소드들을 제공합니다. Object 프로토타입 객체에 대한 변경 내용은  그 변경 내용에 영향을 받는 속성들과 메소드들이 프로토타입 체인(chain)을 따라 더이상 무시되지 않는한,  모든 객체들로 전달됩니다.

@@ -105,9 +105,9 @@ new Object([value])
{{page('/ko/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype', '메서드') }}
-

예제

+

예제

-

undefinednull을 지정

+

undefinednull을 지정

다음 예제는 변수 o에 빈 Object 객체를 저장합니다.

@@ -170,7 +170,7 @@ var o = new Object(Boolean());

{{Compat("javascript.builtins.Object")}}

-

같이 보기

+

같이 보기