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 --- .../web/javascript/reference/statements/async_function/index.html | 4 ++-- files/ko/web/javascript/reference/statements/const/index.html | 2 +- .../ko/web/javascript/reference/statements/do...while/index.html | 2 +- files/ko/web/javascript/reference/statements/export/index.html | 4 ++-- files/ko/web/javascript/reference/statements/for...in/index.html | 8 ++++---- files/ko/web/javascript/reference/statements/for/index.html | 2 +- files/ko/web/javascript/reference/statements/if...else/index.html | 2 +- files/ko/web/javascript/reference/statements/import/index.html | 2 +- files/ko/web/javascript/reference/statements/index.html | 2 +- files/ko/web/javascript/reference/statements/switch/index.html | 2 +- files/ko/web/javascript/reference/statements/var/index.html | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) (limited to 'files/ko/web/javascript/reference/statements') diff --git a/files/ko/web/javascript/reference/statements/async_function/index.html b/files/ko/web/javascript/reference/statements/async_function/index.html index ab34076481..28fbcaf016 100644 --- a/files/ko/web/javascript/reference/statements/async_function/index.html +++ b/files/ko/web/javascript/reference/statements/async_function/index.html @@ -38,9 +38,9 @@ translation_of: Web/JavaScript/Reference/Statements/async_function
statements
-
함수본문을 구성하는 내용.
+
함수 본문을 구성하는 내용.
-

반환 값

+

반환 값

Promise : async 함수에 의해 반환 된 값으로 해결되거나 async함수 내에서 발생하는 캐치되지 않는 예외로 거부되는 값.

diff --git a/files/ko/web/javascript/reference/statements/const/index.html b/files/ko/web/javascript/reference/statements/const/index.html index 1cbd7ea7aa..00f1eed2e9 100644 --- a/files/ko/web/javascript/reference/statements/const/index.html +++ b/files/ko/web/javascript/reference/statements/const/index.html @@ -34,7 +34,7 @@ translation_of: Web/JavaScript/Reference/Statements/const

상수는 let 문을 사용하여 정의된 변수와 마찬가지로 블록 범위(block-scope)입니다. 상수의 값은 재할당을 통해 바뀔 수 없고 재선언될 수 없습니다.

-

let에 적용한 "일시적 사각 지대"에 관한 모든 고려는, const에도 적용합니다.

+

let에 적용한 "일시적 사각 지대"에 관한 모든 고려는, const에도 적용합니다.

상수는 같은 범위의 상수 또는 변수와 그 이름을 공유할 수 없습니다.

diff --git a/files/ko/web/javascript/reference/statements/do...while/index.html b/files/ko/web/javascript/reference/statements/do...while/index.html index 3e54d6367f..9cd6ed0e5c 100644 --- a/files/ko/web/javascript/reference/statements/do...while/index.html +++ b/files/ko/web/javascript/reference/statements/do...while/index.html @@ -30,7 +30,7 @@ while (조건식);
루프가 실행될 때마다 평가되는 식입니다. 만약 조건식이 참으로 평가되었다면, 구문 이 다시 실행됩니다. 만약 조건식이 거짓으로 평가되었다면, 자바스크립트는 do...while. 구문 밑에 있는 구문들을 실행시킵니다.
-

예제

+

예제

do...while

diff --git a/files/ko/web/javascript/reference/statements/export/index.html b/files/ko/web/javascript/reference/statements/export/index.html index 1c15d4e7f9..98cb2ee55a 100644 --- a/files/ko/web/javascript/reference/statements/export/index.html +++ b/files/ko/web/javascript/reference/statements/export/index.html @@ -148,7 +148,7 @@ console.log(foo); // 4.555806215962888

기본 내보내기 사용

-

단일 값을 내보낼 때나 모듈의 폴백fallback 값이 필요할 땐 기본 내보내기를 사용할 수 있습니다.

+

단일 값을 내보낼 때나 모듈의 폴백 값이 필요할 땐 기본 내보내기를 사용할 수 있습니다.

// module "my-module.js"
 export default function cube(x) {
@@ -160,7 +160,7 @@ export default function cube(x) {
 
import cube from './my-module.js';
 console.log(cube(3)); // 27
-

export default를 사용할 때 var, let, const는 사용하지 못합니다.

+

export default를 사용할 때 var, let, const는 사용하지 못합니다.

명세

diff --git a/files/ko/web/javascript/reference/statements/for...in/index.html b/files/ko/web/javascript/reference/statements/for...in/index.html index d51a3c79dc..f5e54dcac2 100644 --- a/files/ko/web/javascript/reference/statements/for...in/index.html +++ b/files/ko/web/javascript/reference/statements/for...in/index.html @@ -12,11 +12,11 @@ translation_of: Web/JavaScript/Reference/Statements/for...in

{{EmbedInteractiveExample("pages/js/statement-forin.html")}}

-

문법

+

문법

for (variable in object) { ... }
-

파라미터

+

파라미터

variable
@@ -25,7 +25,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in
반복작업을 수행할 객체로 열거형 속성을 가지고 있는 객체.
-

설명

+

설명

for...in문은 열거 가능한 non-Symbol 속성에 대해서만 반복합니다.
ArrayObject 등 내장 constructor를 통해 만들어진 객체는  {{jsxref("String")}}의 {{jsxref("String.indexOf", "indexOf()")}}, {{jsxref("Object")}}의 {{jsxref("Object.toString", "toString()")}}와 같이 Object.prototype, String.prototype 로부터 열거가 가능하지 않은 속성들을 상속해왔습니다. for...in문은 객체 자체의 모든 열거 가능한 속성들과 프로토타입 체인으로부터 상속받은 속성들에 대해 반복할 것입니다. (더 가까운 프로토타입의 속성들이 프로토타입 체인 객체로부터 더 멀리 떨어진 프로토 타입의 속성보다 더 우선합니다.)

@@ -58,7 +58,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in

이것은 쉽게 객체의 속성을 확인(콘솔이나 다른 방법으로 출력)할 수 있기 때문에 실질적으로 디버깅을 위해 사용될 수 있습니다. 배열이 데이터의 저장에 있어서는 더 실용적이지만, 키-값 쌍이 선호되는 데이터의 경우(속성이 "key"의 역할을 함) 특정 값을 가진 키가 있는지 확인하려는 경우에 for...in을 사용할 수 있습니다.

-

예제

+

예제

for...in의 사용

diff --git a/files/ko/web/javascript/reference/statements/for/index.html b/files/ko/web/javascript/reference/statements/for/index.html index cba49dbba6..57c0df4971 100644 --- a/files/ko/web/javascript/reference/statements/for/index.html +++ b/files/ko/web/javascript/reference/statements/for/index.html @@ -24,7 +24,7 @@ translation_of: Web/JavaScript/Reference/Statements/for
initialization
-
식(할당식 포함) 또는 변수 선언. 주로 카운터 변수를 초기화할 때 사용합니다. var 또는 let 키워드를 사용해 새로운 변수를 선언할 수도 있습니다. var 키워드로 선언한 변수는 반복문에 제한되지 않습니다. 즉 for 문과 같은 범위scope에 위치합니다. let 키워드로 선언한 변수는 반복문의 지역 변수가 됩니다.
+
식(할당식 포함) 또는 변수 선언. 주로 카운터 변수를 초기화할 때 사용합니다. var 또는 let 키워드를 사용해 새로운 변수를 선언할 수도 있습니다. var 키워드로 선언한 변수는 반복문에 제한되지 않습니다. 즉 for 문과 같은 범위에 위치합니다. let 키워드로 선언한 변수는 반복문의 지역 변수가 됩니다.

식의 결과는 버려집니다.
condition
diff --git a/files/ko/web/javascript/reference/statements/if...else/index.html b/files/ko/web/javascript/reference/statements/if...else/index.html index a6fb34c1ac..4e4c2abecc 100644 --- a/files/ko/web/javascript/reference/statements/if...else/index.html +++ b/files/ko/web/javascript/reference/statements/if...else/index.html @@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Statements/if...else
statement1
조건이 참으로 평가될 경우 실행되는 문입니다.
- 중첩된 if구문을 포함하여 어떤 구문이든 쓸 수 있습니다. 다중구문을 사용할 경우  ({ ... })블럭 구문 으로 그룹화 하고 실행하지 않으려면  구문을 사용합니다.
+ 중첩된 if구문을 포함하여 어떤 구문이든 쓸 수 있습니다. 다중구문을 사용할 경우  ({ ... })블럭 구문 으로 그룹화 하고 실행하지 않으려면  구문을 사용합니다.
diff --git a/files/ko/web/javascript/reference/statements/import/index.html b/files/ko/web/javascript/reference/statements/import/index.html index ce3a1536cb..8a4c9004e5 100644 --- a/files/ko/web/javascript/reference/statements/import/index.html +++ b/files/ko/web/javascript/reference/statements/import/index.html @@ -48,7 +48,7 @@ var promise = import("module-name");

설명

-

name 파라미터는 export 되는 멤버를 받을 오브젝트의 이름입니다. member 파라미터는 각각의 멤버를 지정하지만, name 파라미터는 모두를 가져옵니다. 모듈에서 name 은 멤버 대신 하나의 default 파라미터를 통해 export 하는 경우에도 동작할 수 있습니다. 다음의 명확한 예제 문법을 살펴봅시다.

+

name 파라미터는 export 되는 멤버를 받을 오브젝트의 이름입니다. member 파라미터는 각각의 멤버를 지정하지만, name 파라미터는 모두를 가져옵니다. 모듈에서 name 은 멤버 대신 하나의 default 파라미터를 통해 export 하는 경우에도 동작할 수 있습니다. 다음의 명확한 예제 문법을 살펴봅시다.

모듈 전체를 가져옵니다. export 한 모든 것들을 현재 범위(스크립트 파일 하나로 구분되는 모듈 범위) 내에 myModule 로 바인딩되어 들어갑니다.

diff --git a/files/ko/web/javascript/reference/statements/index.html b/files/ko/web/javascript/reference/statements/index.html index cd83b9f1c0..bf423222d2 100644 --- a/files/ko/web/javascript/reference/statements/index.html +++ b/files/ko/web/javascript/reference/statements/index.html @@ -53,7 +53,7 @@ translation_of: Web/JavaScript/Reference/Statements
{{jsxref("Statements/function", "function")}}
지정된 매개변수를 갖는 함수를 선언합니다.
{{jsxref("Statements/function*", "function*")}}
-
반복기를 더 쉽게 작성할 수 있게 하는 생성기 함수.
+
반복기를 더 쉽게 작성할 수 있게 하는 생성기 함수.
{{jsxref("Statements/return", "return")}}
함수에 의해 반환되는 값을 지정합니다.
{{jsxref("Statements/class", "class")}}
diff --git a/files/ko/web/javascript/reference/statements/switch/index.html b/files/ko/web/javascript/reference/statements/switch/index.html index b4eb68e5a7..46b13e380d 100644 --- a/files/ko/web/javascript/reference/statements/switch/index.html +++ b/files/ko/web/javascript/reference/statements/switch/index.html @@ -49,7 +49,7 @@ translation_of: Web/JavaScript/Reference/Statements/switch

If no matching case clause is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements. If no default clause is found, the program continues execution at the statement following the end of switch. By convention, the default clause is the last clause, but it does not need to be so.

-

The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. If break is omitted, the program continues execution at the next statement in the switch statement.

+

The optional break statement associated with each case label ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. If break is omitted, the program continues execution at the next statement in the switch statement.

예제

diff --git a/files/ko/web/javascript/reference/statements/var/index.html b/files/ko/web/javascript/reference/statements/var/index.html index 4366c3ed73..6b71309f7b 100644 --- a/files/ko/web/javascript/reference/statements/var/index.html +++ b/files/ko/web/javascript/reference/statements/var/index.html @@ -109,7 +109,7 @@ var a, b = a = "A"; console.log(x + y); // undefinedA -

여기, x와 y는 어떠한 코드 실행하기 전에 선언되었다, 할당은 후에 발생하였다. "x = y"가 실행될 때, y는 존재하여 ReferenceError를 출력하진 않고 값은 'undefined' 입니다. 그래서, x는 undefined 값이 할당 됩니다. 그리고나서, y는 'A' 값이 할당 됩니다. 결과적으로, 첫번째 줄 이후에, x === undefined && y === 'A', 이와 같은 결과가 됩니다.

+

여기, x와 y는 어떠한 코드 실행하기 전에 선언되었다, 할당은 후에 발생하였다. "x = y"가 실행될 때, y는 존재하여 ReferenceError를 출력하진 않고 값은 'undefined' 입니다. 그래서, x는 undefined 값이 할당 됩니다. 그리고나서, y는 'A' 값이 할당 됩니다. 결과적으로, 첫번째 줄 이후에, x === undefined && y === 'A', 이와 같은 결과가 됩니다.

다수의 변수들의 초기화

-- cgit v1.2.3-54-g00ecf