From cc28b31f501b06acb38aedcd4e3f5029ec838699 Mon Sep 17 00:00:00 2001 From: 3indblown Leaf <69508345+kraccoon-dev@users.noreply.github.com> Date: Wed, 2 Feb 2022 00:37:06 +0900 Subject: remove class 2 (#3923) --- .../reference/statements/async_function/index.html | 16 ++++++++-------- .../reference/statements/do...while/index.html | 4 ++-- .../reference/statements/for...in/index.html | 8 ++++---- .../reference/statements/try...catch/index.html | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 24 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 c1827af8e2..a2dd584d1f 100644 --- a/files/ko/web/javascript/reference/statements/async_function/index.html +++ b/files/ko/web/javascript/reference/statements/async_function/index.html @@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Statements/async_function

Syntax

-
async function name([param[, param[, ... param]]]) {
+
async function name([param[, param[, ... param]]]) {
     statements
 }
 
@@ -63,13 +63,13 @@ translation_of: Web/JavaScript/Reference/Statements/async_function

예를 들어

-
async function foo() {
+
async function foo() {
     return 1
 }

위 코드는 아래와 같습니다.

-
function foo() {
+
function foo() {
     return Promise.resolve(1)
 }
@@ -77,13 +77,13 @@ translation_of: Web/JavaScript/Reference/Statements/async_function

예를 들어

-
async function foo() {
+
async function foo() {
     await 1
 }

위 코드는 아래와 같습니다.

-
function foo() {
+
function foo() {
     return Promise.resolve(1).then(() => undefined)
 }
 
@@ -92,7 +92,7 @@ translation_of: Web/JavaScript/Reference/Statements/async_function

Simple example

-
var resolveAfter2Seconds = function() {
+
var resolveAfter2Seconds = function() {
   console.log("starting slow promise");
   return new Promise(resolve => {
     setTimeout(function() {
@@ -169,7 +169,7 @@ setTimeout(parallel, 10000); // trully parallel: after 1 second, logs "fast", th
 

{{jsxref("Promise")}} 를 반환하는 API는 promise chain을 만들며 여러 파트의 함수로 나뉜다.
아래 코드를 보자.

-
function getProcessedData(url) {
+
function getProcessedData(url) {
   return downloadData(url) // returns a promise
     .catch(e => {
       return downloadFallbackData(url) // returns a promise
@@ -182,7 +182,7 @@ setTimeout(parallel, 10000); // trully parallel: after 1 second, logs "fast", th
 
 

위의 코드는 하나의 async함수로 아래와 같이 쓰여질 수도 있다.

-
async function getProcessedData(url) {
+
async function getProcessedData(url) {
   let v;
   try {
     v = await downloadData(url);
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 9cd6ed0e5c..5b869ddb82 100644
--- a/files/ko/web/javascript/reference/statements/do...while/index.html
+++ b/files/ko/web/javascript/reference/statements/do...while/index.html
@@ -15,7 +15,7 @@ translation_of: Web/JavaScript/Reference/Statements/do...while
 
 

문법

-
do구문
+
do구문
 while (조건식);
 
@@ -36,7 +36,7 @@ while (조건식);

예제에서 do...while 문은 적어도 한번 반복되고 i 변수가 5 보다 작을 때까지 실행됩니다.

-
var result = '';
+
var result = '';
 var i = 0;
 do {
    i += 1;
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 f5e54dcac2..5748e2f097 100644
--- a/files/ko/web/javascript/reference/statements/for...in/index.html
+++ b/files/ko/web/javascript/reference/statements/for...in/index.html
@@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Statements/for...in
 
 

문법

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

파라미터

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

아래의 예는 열거 가능한 non-Symbol속성들을 반복해서 속성의 이름과 그 값을 기록합니다.

-
var obj = {a: 1, b: 2, c: 3};
+
var obj = {a: 1, b: 2, c: 3};
 
 for (const prop in obj) {
   console.log(`obj.${prop} = ${obj[prop]}`);
@@ -79,7 +79,7 @@ for (const prop in obj) {
 
 

아래는 {{jsxref("Object.prototype.hasOwnProperty", "hasOwnProperty()")}} 를 사용하는 예를 보여주고 있습니다. 상속된 속성은 표시되지 않습니다.

-
var triangle = {a:1, b:2, c:3};
+
var triangle = {a:1, b:2, c:3};
 
 function ColoredTriangle() {
   this.color = "red";
@@ -148,7 +148,7 @@ alert(show_own_props(o, "o")); /* alerts: o.color = red */
 
 

Prior to SpiderMonkey 40 {{geckoRelease(40)}}, it was possible to use an initializer expression (i=0) in a for...in loop:

-
var obj = {a: 1, b: 2, c: 3};
+
var obj = {a: 1, b: 2, c: 3};
 for (var i = 0 in obj) {
   console.log(obj[i]);
 }
diff --git a/files/ko/web/javascript/reference/statements/try...catch/index.html b/files/ko/web/javascript/reference/statements/try...catch/index.html
index a96c81e1a5..889fa2e7bb 100644
--- a/files/ko/web/javascript/reference/statements/try...catch/index.html
+++ b/files/ko/web/javascript/reference/statements/try...catch/index.html
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Statements/try...catch
 
 

문법

-
try {
+
try {
   try_statements
 }
 [catch (exception_var) {
@@ -67,7 +67,7 @@ translation_of: Web/JavaScript/Reference/Statements/try...catch
 
 
 
-
try {
+
try {
    throw "myException"; // generates an exception
 }
 catch (e) {
@@ -82,7 +82,7 @@ catch (e) {
 
 
 
-
try {
+
try {
   myroutine(); // may throw three types of exceptions
 } catch (e) {
   if (e instanceof TypeError) {
@@ -102,7 +102,7 @@ catch (e) {
 
 

이에 대한 일반적인 사용 사례는 예상 오류의 작은 하위 집합 만 포착 (및 침묵) 한 다음 다른 경우에 오류를 다시 발생시키는 것입니다.

-
try {
+
try {
   myRoutine();
 } catch (e) {
   if (e instanceof RangeError) {
@@ -118,7 +118,7 @@ catch (e) {
 
 
 
-
function isValidJSON(text) {
+
function isValidJSON(text) {
   try {
     JSON.parse(text);
     return true;
@@ -135,7 +135,7 @@ catch (e) {
 
 

The following example shows one use case for the finally-block. The code opens a file and then executes statements that use the file; the finally-block makes sure the file always closes after it is used even if an exception was thrown.

-
openMyFile();
+
openMyFile();
 try {
   // tie up a resource
   writeMyFile(theData);
@@ -150,7 +150,7 @@ finally {
 
 

First, let's see what happens with this:

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -169,7 +169,7 @@ catch (ex) {
 
 

Now, if we already caught the exception in the inner try-block by adding a catch-block

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -191,7 +191,7 @@ catch (ex) {
 
 

And now, let's rethrow the error.

-
try {
+
try {
   try {
     throw new Error('oops');
   }
@@ -219,7 +219,7 @@ catch (ex) {
 
 

If the finally-block returns a value, this value becomes the return value of the entire try-catch-finally statement, regardless of any return statements in the try and catch-blocks. This includes exceptions thrown inside of the catch-block:

-
(function() {
+
(function() {
   try {
     try {
       throw new Error('oops');
-- 
cgit v1.2.3-54-g00ecf