From d92346aff7a17186aabce61c3ab91aeea79acf5a Mon Sep 17 00:00:00 2001 From: Allo Date: Wed, 17 Jul 2024 11:29:54 +0800 Subject: [PATCH] Fix formatting --- .../reference/errors/invalid_for-in_initializer/index.md | 8 +++----- .../reference/errors/invalid_for-in_initializer/index.md | 8 +++----- .../reference/errors/invalid_for-in_initializer/index.md | 8 +++----- .../reference/global_objects/math/atan2/index.md | 2 +- .../web/javascript/reference/statements/for...in/index.md | 2 +- .../reference/errors/invalid_for-in_initializer/index.md | 2 +- .../web/javascript/reference/statements/for...in/index.md | 6 +++--- .../web/javascript/reference/statements/for...in/index.md | 8 ++++---- .../reference/errors/invalid_for-in_initializer/index.md | 8 +++----- 9 files changed, 22 insertions(+), 30 deletions(-) diff --git a/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 8dd6d1d1f11fa8..22847019626b1b 100644 --- a/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ L'en-tête d'une boucle [`for...in`](/fr/docs/Web/JavaScript/Reference/Instructi Cet exemple déclenchera une exception `SyntaxError` : -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 6113092cba08d5..bb5334105aa4f0 100644 --- a/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -27,12 +27,10 @@ SyntaxError: for-in loop variable declaration may not have an initializer. (Chro この例では `SyntaxError` が発生します。 -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md index a47c1de13b9339..d0b8d64df2b681 100644 --- a/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ slug: Web/JavaScript/Reference/Errors/Invalid_for-in_initializer 이 예제는 `SyntaxError`를 발생시킵니다. -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ko/web/javascript/reference/global_objects/math/atan2/index.md b/files/ko/web/javascript/reference/global_objects/math/atan2/index.md index 4923314a6d0d47..12981a24db1641 100644 --- a/files/ko/web/javascript/reference/global_objects/math/atan2/index.md +++ b/files/ko/web/javascript/reference/global_objects/math/atan2/index.md @@ -88,7 +88,7 @@ function format(template, ...args) { ...args.map((num) => (Object.is(num, -0) ? "-0" - : formattedNumbers.get(num) ?? String(num) + : (formattedNumbers.get(num) ?? String(num)) ).padEnd(5), ), ); diff --git a/files/ko/web/javascript/reference/statements/for...in/index.md b/files/ko/web/javascript/reference/statements/for...in/index.md index b5ebc46dede323..9dff5aae36419f 100644 --- a/files/ko/web/javascript/reference/statements/for...in/index.md +++ b/files/ko/web/javascript/reference/statements/for...in/index.md @@ -117,7 +117,7 @@ alert(show_own_props(o, "o")); /* alerts: o.color = red */ Prior to Firefox 40, it was possible to use an initializer expression (`i=0`) in a `for...in` loop: -```js example-bad +```js-nolint example-bad const obj = { a: 1, b: 2, c: 3 }; for (var i = 0 in obj) { console.log(obj[i]); diff --git a/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 37d3a1845ca744..f2b6547fb5688c 100644 --- a/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -35,7 +35,7 @@ No [modo estrito](/pt-BR/docs/Web/JavaScript/Reference/Strict_mode), contudo, é Esse exemplo lança um `SyntaxError`: -```js example-bad +```js-nolint example-bad const obj = { a: 1, b: 2, c: 3 }; for (const i = 0 in obj) { diff --git a/files/pt-br/web/javascript/reference/statements/for...in/index.md b/files/pt-br/web/javascript/reference/statements/for...in/index.md index 61aba948a21513..256f35b086aebe 100644 --- a/files/pt-br/web/javascript/reference/statements/for...in/index.md +++ b/files/pt-br/web/javascript/reference/statements/for...in/index.md @@ -92,9 +92,9 @@ for (var prop in obj) { Anterior ao SpiderMonkey 40, era possível usar uma expressão inicial com o laço for...in, conforme exemplo que se segue: -```js example-bad -var obj = {a:1, b:2, c:3}; -for(var i=0 in obj) { +```js-nolint example-bad +var obj = { a: 1, b: 2, c: 3 }; +for (var i = 0 in obj) { console.log(obj[i]); } // 1 diff --git a/files/ru/web/javascript/reference/statements/for...in/index.md b/files/ru/web/javascript/reference/statements/for...in/index.md index d03db49a9a1499..0fc61307dce0f9 100644 --- a/files/ru/web/javascript/reference/statements/for...in/index.md +++ b/files/ru/web/javascript/reference/statements/for...in/index.md @@ -89,11 +89,11 @@ for (var prop in obj) { ## Поддержка: инициализатор переменных -До SpiderMonkey 40, можно было инициализировать переменные (`i=0`) в цикле `for...in`: +До SpiderMonkey 40, можно было инициализировать переменные (`i = 0`) в цикле `for...in`: -```js example-bad -var obj = {a:1, b:2, c:3}; -for(var i=0 in obj) { +```js-nolint example-bad +var obj = { a: 1, b: 2, c: 3 }; +for (var i = 0 in obj) { console.log(obj[i]); } // 1 diff --git a/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 573ffd6e2f36be..9a804d0b3f631d 100644 --- a/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ SyntaxError: for-in loop variable declaration may not have an initializer. (Chro 下面这个示例会报语法错误(`SyntaxError`): -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); }