diff --git a/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/change-the-presentation-of-a-bar-chart.md b/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/change-the-presentation-of-a-bar-chart.md
index 46b6e2613d1..c04d6189d02 100644
--- a/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/change-the-presentation-of-a-bar-chart.md
+++ b/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/change-the-presentation-of-a-bar-chart.md
@@ -1,6 +1,6 @@
---
id: 587d7fa8367417b2b2512bca
-title: Change the Presentation of a Bar Chart
+title: تغيير تقديم مخطط الأعمدة (Bar Chart)
challengeType: 6
forumTopicId: 301481
dashedName: change-the-presentation-of-a-bar-chart
diff --git a/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/dynamically-set-the-coordinates-for-each-bar.md b/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/dynamically-set-the-coordinates-for-each-bar.md
index a22cd4cff21..de494234b73 100644
--- a/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/dynamically-set-the-coordinates-for-each-bar.md
+++ b/curriculum/challenges/arabic/04-data-visualization/data-visualization-with-d3/dynamically-set-the-coordinates-for-each-bar.md
@@ -10,11 +10,11 @@ dashedName: dynamically-set-the-coordinates-for-each-bar
التحدي السابق أنشئت وألحقت مستطيل بعنصر `svg` لكل نقطة في `dataset` لتستعرض شريط. لسوء الحظ، كانوا مكدسين بعضَهم فوق بعض.
-يمكنك تحكم في موضع المستطيل بواسطة أستخدام سمات (attributes) تسمى `x` و `y`. لتخبر D3 أين يبدأ في رسم الشكل في منطقة `svg`. The last challenge set them each to 0, so every bar was placed in the upper-left corner.
+يمكنك تحكم في موضع المستطيل بواسطة أستخدام سمات (attributes) تسمى `x` و `y`. لتخبر D3 أين يبدأ في رسم الشكل في منطقة `svg`. قام التحدي السابق بتحديدهم إلى صفر، لذلك تم وضع كل عمود (bar) في الزاوية العلوية اليسرى.
-For a bar chart, all of the bars should sit on the same vertical level, which means the `y` value stays the same (at 0) for all bars. The `x` value, however, needs to change as you add new bars. Remember that larger `x` values push items farther to the right. As you go through the array elements in `dataset`, the `x` value should increase.
+للحصول على رسم بياني للأعمدة (bar chart)، يجب أن تجلس جميع الأعمدة على نفس المستوى العمودي، مما يعني أن قيمة `y` تبقى هي نفسها (عند 0) لجميع الأعمدة. ومع ذلك، تحتاج قيمة `x` إلى التغيير عند إضافة أعمدة جديد. تذكر أن أكبر قيم من `x` تدفع العناصر إلى أقصى اليمين. عندما تمر عبر عناصر القائمة في `dataset`، يجب أن تزيد قيمة `x`.
-The `attr()` method in D3 accepts a callback function to dynamically set that attribute. The callback function takes two arguments, one for the data point itself (usually `d`) and one for the index of the data point in the array. The second argument for the index is optional. Here's the format:
+تقبل طريقة (method) تسمى `attr()` في D3 الوظيفة تعيد تفعيل (callback functon) التي تعيين تلك السمة ديناميكيا. وظيفة تعيد تفعيل (callback functon) تأخذ حجيتين (arguments)، واحد لنقطة البيانات نفسها (عادة `d`) وواحد لترتيب نقطة البيانات في القائمة (array). أما الحِجَّة (argument) الثانية تدل على الترتيب فهي حِجَّة اختيارية. إليك التنسيق:
```js
selection.attr("property", (d, i) => {
@@ -22,65 +22,65 @@ selection.attr("property", (d, i) => {
})
```
-It's important to note that you do NOT need to write a `for` loop or use `forEach()` to iterate over the items in the data set. Recall that the `data()` method parses the data set, and any method that's chained after `data()` is run once for each item in the data set.
+من المهم مُراعاةٌ أنك لا تحتاج إلى كتابة حلقة (loop) نوعها `for` أو استخدام `forEach()` لتكرار العناصر في مجموعة البيانات (data set). تذكر أن طريقة `data()` تحلل مجموعة البيانات (data set), وأي طريقة تتبع `data()` يتم تشغيلها مرة واحدة لكل عنصر في مجموعة البيانات.
# --instructions--
-Change the `x` attribute callback function so it returns the index times 30.
+غيّر سمة `x` في وظيفة تعيد تفعيل بحيث ترجع الترتيب 30 مرة.
-**Note:** Each bar has a width of 25, so increasing each `x` value by 30 adds some space between the bars. Any value greater than 25 would work in this example.
+**ملاحظة:** كل عمود له عرض (width) بقيمة 25، لذا زيادة كل قيمة `x` بمقدار 30 تضيف بعض المساحة بين الأعمدة. أي قيمة أكبر من 25 ستنجح في هذا المثال.
# --hints--
-The first `rect` should have an `x` value of `0`.
+يجب أن يحتوي أول `rect` على `x` بقيمة `0`.
```js
assert($('rect').eq(0).attr('x') == '0');
```
-The second `rect` should have an `x` value of `30`.
+يجب أن يحتوي ثاني `rect` على `x` بقيمة `30`.
```js
assert($('rect').eq(1).attr('x') == '30');
```
-The third `rect` should have an `x` value of `60`.
+يجب أن يحتوي ثالث `rect` على `x` بقيمة `60`.
```js
assert($('rect').eq(2).attr('x') == '60');
```
-The fourth `rect` should have an `x` value of `90`.
+يجب أن يحتوي رابع `rect` على `x` بقيمة `90`.
```js
assert($('rect').eq(3).attr('x') == '90');
```
-The fifth `rect` should have an `x` value of `120`.
+يجب أن يحتوي خامس `rect` على `x` بقيمة `120`.
```js
assert($('rect').eq(4).attr('x') == '120');
```
-The sixth `rect` should have an `x` value of `150`.
+يجب أن يحتوي سادس `rect` على `x` بقيمة `150`.
```js
assert($('rect').eq(5).attr('x') == '150');
```
-The seventh `rect` should have an `x` value of `180`.
+يجب أن يحتوي سابع `rect` على `x` بقيمة `180`.
```js
assert($('rect').eq(6).attr('x') == '180');
```
-The eighth `rect` should have an `x` value of `210`.
+يجب أن يحتوي ثامن `rect` على `x` بقيمة `210`.
```js
assert($('rect').eq(7).attr('x') == '210');
```
-The ninth `rect` should have an `x` value of `240`.
+يجب أن يحتوي تاسع `rect` على `x` بقيمة `240`.
```js
assert($('rect').eq(8).attr('x') == '240');
diff --git a/curriculum/challenges/arabic/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.md b/curriculum/challenges/arabic/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.md
index c47298db4f6..b2bf1b3f2de 100644
--- a/curriculum/challenges/arabic/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.md
+++ b/curriculum/challenges/arabic/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.md
@@ -1,6 +1,6 @@
---
id: 587d7fad367417b2b2512be1
-title: Handle Click Events with JavaScript using the onclick property
+title: التعامل مع أحداث النقر (Handle Click Events) مع JavaScript باستخدام خاصية عند النقر (onclick)
challengeType: 6
forumTopicId: 301503
dashedName: handle-click-events-with-javascript-using-the-onclick-property
@@ -8,7 +8,7 @@ dashedName: handle-click-events-with-javascript-using-the-onclick-property
# --description--
-You want your code to execute only once your page has finished loading. لهذا الغرض، يمكنك إرفاق حدث (event) من JavaScript لمستند مسمى `DOMContentLoaded`. إليك كود الذي يفعل ذلك:
+تريد تنفذ كودك بمجرد الانتهاء من تحميل الصفحة, مرة واحدة فقط. لهذا الغرض، يمكنك إرفاق حدث (event) من JavaScript لمستند مسمى `DOMContentLoaded`. إليك كود الذي يفعل ذلك:
```js
document.addEventListener('DOMContentLoaded', function() {
diff --git a/curriculum/challenges/arabic/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/arabic/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b452d276002..7731f012f88 100644
--- a/curriculum/challenges/arabic/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/arabic/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
index 25339c041c4..c2cd5839ea2 100644
--- a/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
+++ b/curriculum/challenges/chinese-traditional/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
@@ -19,7 +19,7 @@ dashedName: build-a-survey-form
1. 在表單元素內,你**需要**在 `input` 字段中輸入你的郵箱,該字段的 `id` 爲 `email`
1. 如果你輸入了格式不正確的郵箱,你將會看見 HTML5 驗證錯誤信息
1. 在表單中,你可以在 `input` 字段中輸入一個數字,該字段的 `id` 爲 `number`
-1. The number input should not accept non-numbers, either by preventing you from typing them or by showing an HTML5 validation error (depending on your browser).
+1. 數字輸入不應接受非數字,或是阻止你輸入它們,或是顯示一個 HTML5 驗證錯誤(取決於你的瀏覽器)。
1. 如果你輸入的數字超出了範圍(使用 `min` 和 `max` 屬性定義),你將會看見 HTML5 驗證錯誤信息
1. 表單中的名字、郵箱和數字輸入框需有對應的包含描述輸入框用途的 `label` 元素,id 應分別爲 `id="name-label"`、`id="email-label"` 和 `id="number-label"`
1. 在表單中的名字、郵箱和數字輸入框中,你能看到各自的描述文字作爲佔位符
diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
index 9675413783f..f919d96cc4c 100644
--- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
+++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
@@ -9,7 +9,7 @@ dashedName: access-multi-dimensional-arrays-with-indexes
# --description--
-我們可以把多維數組看作成是*數組中的數組*。 When you use brackets to access your array, the first set of brackets refers to the entries in the outermost (the first level) array, and each additional pair of brackets refers to the next level of entries inside.
+我們可以把多維數組看作成是*數組中的數組*。 當你使用括號訪問你的數組時,第一組括號指的是最外層(第一層)數組中的條目,而每一對額外的括號指的是裏面下一層的條目。
**例如:**
diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
index af623427b61..510a2d80048 100644
--- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
+++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
@@ -24,7 +24,7 @@ dashedName: catch-misspelled-variable-and-function-names
assert(netWorkingCapital === 2);
```
-There should be no instances of misspelled variables in the code.
+代碼中不應該有拼寫錯誤的變量實例。
```js
assert(!code.match(/recievables/g));
@@ -36,7 +36,7 @@ assert(!code.match(/recievables/g));
assert(code.match(/receivables/g).length == 2);
```
-There should be no instances of misspelled variables in the code.
+代碼中不應該有拼寫錯誤的變量實例。
```js
assert(!code.match(/payable;/g));
diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
index 8376e2c5fd3..2b265e1f501 100644
--- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
+++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
@@ -26,11 +26,11 @@ console.log(arr);
# --instructions--
-Use a destructuring assignment with the rest parameter to emulate the behavior of `Array.prototype.slice()`. `removeFirstTwo()` should return a sub-array of the original array `list` with the first two elements omitted.
+使用一個帶有 rest 參數的解構賦值來模擬 `Array.prototype.slice()` 的行爲。 `removeFirstTwo()` 應該返回原始數組 `list` 的子數組,前兩個元素被省略。
# --hints--
-`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]`
+`removeFirstTwo([1, 2, 3, 4, 5])` 應該返回 `[3, 4, 5]`。
```js
const testArr_ = [1, 2, 3, 4, 5];
@@ -38,7 +38,7 @@ const testArrWORemoved_ = removeFirstTwo(testArr_);
assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3);
```
-`removeFirstTwo()` should not modify `list`
+`removeFirstTwo()` 不應該修改 `list`。
```js
const testArr_ = [1, 2, 3, 4, 5];
diff --git a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
index 2ea4735758e..22cac0bf419 100644
--- a/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
+++ b/curriculum/challenges/chinese-traditional/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
@@ -58,27 +58,27 @@ myRegex.lastIndex = 0;
assert(!myRegex.test('Frank Roosevelt'));
```
-Your regex `myRegex` should return `false` for the string `FranklinRoosevelt`
+你的正則 `myRegex` 測試 `FranklinRoosevelt` 應該返回 `false`。
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('FranklinRoosevelt'));
```
-Your regex `myRegex` should return `false` for the string `EleanorRoosevelt`
+你的正則 `myRegex` 測試 `EleanorRoosevelt` 應該返回 `false`。
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('EleanorRoosevelt'));
```
-You should use `.test()` to test the regex.
+你應該使用 `.test()` 方法來檢測正則表達式。
```js
assert(code.match(/myRegex.test\(\s*myString\s*\)/));
```
-Your result should return `true`.
+你的返回結果應該爲 `true`。
```js
assert(result === true);
diff --git a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
index ffbe26cedc9..c41f2922a76 100644
--- a/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
+++ b/curriculum/challenges/chinese-traditional/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
@@ -14,7 +14,7 @@ dashedName: connect-redux-to-the-messages-app
# --instructions--
-到目前爲止,我們的編輯器上已包含了整個章節的代碼, 唯一不同的是,React 組件被重新命名爲 `Presentational`,即展示層組件。 創建一個新組件,保存在名爲 `Container` 的常量中。 這個常量用 `connect` 把 `Presentational` 組件和 Redux 連接起來。 然後,在`AppWrapper` 中渲染 React Redux 的 `Provider`組件, 給 `Provider` 傳入 Redux `store` 屬性並渲染 `Container` 爲子組件。 Once everything is set up, you will see the messages app rendered to the page again.
+到目前爲止,我們的編輯器上已包含了整個章節的代碼, 唯一不同的是,React 組件被重新命名爲 `Presentational`,即展示層組件。 創建一個新組件,保存在名爲 `Container` 的常量中。 這個常量用 `connect` 把 `Presentational` 組件和 Redux 連接起來。 然後,在`AppWrapper` 中渲染 React Redux 的 `Provider`組件, 給 `Provider` 傳入 Redux `store` 屬性並渲染 `Container` 爲子組件。 設置完所有內容後,將再次看到消息應用程序渲染到頁面上。
# --hints--
diff --git a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
index 99f4d5e2813..5b6809d6db9 100644
--- a/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
+++ b/curriculum/challenges/chinese-traditional/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
@@ -10,7 +10,7 @@ dashedName: add-a-description-to-your-package-json
一個好的 package.json 文件的下一部分就是 `description` 字段——簡短精悍的的項目描述。
-If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. 然而,這並不是使用描述的唯一場景:它也是一種很好的總結項目的方式, 可以幫助其它開發者、維護者甚至自己在未來快速地瞭解項目,對於任何一個 Node.js 項目來說都非常重要。
+如果有一天你打算向 npm 發佈一個軟件包,當用戶決定是否安裝你的軟件包時,這個字符串就能向用戶表明你的想法。 然而,這並不是使用描述的唯一場景:它也是一種很好的總結項目的方式, 可以幫助其它開發者、維護者甚至自己在未來快速地瞭解項目,對於任何一個 Node.js 項目來說都非常重要。
無論項目計劃是什麼,都建議使用描述。 類似這樣:
diff --git a/curriculum/challenges/chinese-traditional/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md b/curriculum/challenges/chinese-traditional/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
index dd2e9dae767..167b76ff110 100644
--- a/curriculum/challenges/chinese-traditional/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
+++ b/curriculum/challenges/chinese-traditional/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
@@ -16,7 +16,7 @@ HTTP 嚴格傳輸安全(HSTS)是一種網絡安全策略,有助於保護
配置 `helmet.hsts()` 以在未來 90 天內使用 HTTPS。 傳遞配置對象 `{maxAge: timeInSeconds, force: true}`。 你可以創建一個變量 `ninetyDaysInSeconds = 90*24*60*60;` 來用於 `timeInSeconds`。 Replit 已經啓用了 hsts。 要覆蓋它的設置,你需要在配置對象中把 “force” 字段設置爲 true。 我們將攔截並在對其進行檢查測試後恢復 Replit 請求頭。
-Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and an SSL/TLS Certificate.
+注意:在自定義網站上配置 HTTPS 需要獲得一個域名,以及一個 SSL/TLS 證書。
# --hints--
diff --git a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b452d276002..7731f012f88 100644
--- a/curriculum/challenges/chinese-traditional/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/chinese-traditional/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
index 92d1c5cd3e4..1db67062025 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
@@ -58,7 +58,7 @@ You should give the fourth `label` a `for` attribute.
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.htmlFor);
```
-You should give the fourth `label` a `for` attribute matching the `id` of its `input` element.
+你應該給第四個 `label` 一個 `for` 屬性,以匹配其 `input` 元素的 `id`。
```js
const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[3]?.htmlFor;
diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
index 973feafdabb..cd1ed76f879 100644
--- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
+++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
@@ -1,31 +1,31 @@
---
id: 63541ef4f96cd82e8e6c788a
-title: Step 12
+title: 步驟 12
challengeType: 0
dashedName: step-12
---
# --description--
-The `method` attribute specifies how to send form-data to the URL specified in the `action` attribute. The form-data can be sent via a `GET` request as URL parameters (with `method="get"`) or via a `POST` request as data in the request body (with `method="post"`).
+`method` 屬性指定了如何將表單數據發送到 `action` 屬性中指定的 URL。 表單數據可以通過 `GET` 請求作爲 URL 參數發送(`method="get"`)或通過 `POST` 請求作爲請求正文中的數據發送(`method="post"`)。
-Set the `method` attribute to send your form data via a `POST` request.
+設置 `method` 屬性通過 `POST` 請求發送你的表單數據。
# --hints--
-You shouldn't add a new `form` element.
+你不應該添加一個新的 `form` 元素。
```js
assert.equal(document.querySelectorAll('form').length, 1 )
```
-Your `form` element should have a `method` attribute.
+你的 `form` 元素應有一個 `method` 屬性。
```js
assert.exists(document.querySelector('form')?.getAttribute('method'));
```
-Your `method` attribute should be set to `post`.
+你的 `method` 屬性應設置爲 `post`。
```js
assert.equal(document.querySelector('form')?.getAttribute('method'), 'post');
diff --git a/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md b/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
index a87d5d9a74a..78c88c82529 100644
--- a/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
+++ b/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-survey-form.md
@@ -19,7 +19,7 @@ dashedName: build-a-survey-form
1. 在表单元素内,你**需要**在 `input` 字段中输入你的邮箱,该字段的 `id` 为 `email`
1. 如果你输入了格式不正确的邮箱,你将会看见 HTML5 验证错误信息
1. 在表单中,你可以在 `input` 字段中输入一个数字,该字段的 `id` 为 `number`
-1. The number input should not accept non-numbers, either by preventing you from typing them or by showing an HTML5 validation error (depending on your browser).
+1. 数字输入不应接受非数字,或是阻止你输入它们,或是显示一个 HTML5 验证错误(取决于你的浏览器)。
1. 如果你输入的数字超出了范围(使用 `min` 和 `max` 属性定义),你将会看见 HTML5 验证错误信息
1. 表单中的名字、邮箱和数字输入框需有对应的包含描述输入框用途的 `label` 元素,id 应分别为 `id="name-label"`、`id="email-label"` 和 `id="number-label"`
1. 在表单中的名字、邮箱和数字输入框中,你能看到各自的描述文字作为占位符
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
index 92b826c890c..d76f63cb144 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/basic-javascript/access-multi-dimensional-arrays-with-indexes.md
@@ -9,7 +9,7 @@ dashedName: access-multi-dimensional-arrays-with-indexes
# --description--
-我们可以把多维数组看作成是*数组中的数组*。 When you use brackets to access your array, the first set of brackets refers to the entries in the outermost (the first level) array, and each additional pair of brackets refers to the next level of entries inside.
+我们可以把多维数组看作成是*数组中的数组*。 当你使用括号访问你的数组时,第一组括号指的是最外层(第一层)数组中的条目,而每一对额外的括号指的是里面下一层的条目。
**例如:**
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
index 40738eb7654..a58e2bb6e3e 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/debugging/catch-misspelled-variable-and-function-names.md
@@ -24,7 +24,7 @@ dashedName: catch-misspelled-variable-and-function-names
assert(netWorkingCapital === 2);
```
-There should be no instances of misspelled variables in the code.
+代码中不应该有拼写错误的变量实例。
```js
assert(!code.match(/recievables/g));
@@ -36,7 +36,7 @@ assert(!code.match(/recievables/g));
assert(code.match(/receivables/g).length == 2);
```
-There should be no instances of misspelled variables in the code.
+代码中不应该有拼写错误的变量实例。
```js
assert(!code.match(/payable;/g));
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
index 70a71625c2b..5c037034967 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md
@@ -26,11 +26,11 @@ console.log(arr);
# --instructions--
-Use a destructuring assignment with the rest parameter to emulate the behavior of `Array.prototype.slice()`. `removeFirstTwo()` should return a sub-array of the original array `list` with the first two elements omitted.
+使用一个带有 rest 参数的解构赋值来模拟 `Array.prototype.slice()` 的行为。 `removeFirstTwo()` 应该返回原始数组 `list` 的子数组,前两个元素被省略。
# --hints--
-`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]`
+`removeFirstTwo([1, 2, 3, 4, 5])` 应该返回 `[3, 4, 5]`。
```js
const testArr_ = [1, 2, 3, 4, 5];
@@ -38,7 +38,7 @@ const testArrWORemoved_ = removeFirstTwo(testArr_);
assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3);
```
-`removeFirstTwo()` should not modify `list`
+`removeFirstTwo()` 不应该修改 `list`。
```js
const testArr_ = [1, 2, 3, 4, 5];
diff --git a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
index 823f4a0877f..b034bed043e 100644
--- a/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
+++ b/curriculum/challenges/chinese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md
@@ -58,27 +58,27 @@ myRegex.lastIndex = 0;
assert(!myRegex.test('Frank Roosevelt'));
```
-Your regex `myRegex` should return `false` for the string `FranklinRoosevelt`
+你的正则 `myRegex` 测试 `FranklinRoosevelt` 应该返回 `false`。
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('FranklinRoosevelt'));
```
-Your regex `myRegex` should return `false` for the string `EleanorRoosevelt`
+你的正则 `myRegex` 测试 `EleanorRoosevelt` 应该返回 `false`。
```js
myRegex.lastIndex = 0;
assert(!myRegex.test('EleanorRoosevelt'));
```
-You should use `.test()` to test the regex.
+你应该使用 `.test()` 方法来检测正则表达式。
```js
assert(code.match(/myRegex.test\(\s*myString\s*\)/));
```
-Your result should return `true`.
+你的返回结果应该为 `true`。
```js
assert(result === true);
diff --git a/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md b/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
index c248231e876..ceb7579b57d 100644
--- a/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
+++ b/curriculum/challenges/chinese/03-front-end-development-libraries/react-and-redux/connect-redux-to-the-messages-app.md
@@ -14,7 +14,7 @@ dashedName: connect-redux-to-the-messages-app
# --instructions--
-到目前为止,我们的编辑器上已包含了整个章节的代码, 唯一不同的是,React 组件被重新命名为 `Presentational`,即展示层组件。 创建一个新组件,保存在名为 `Container` 的常量中。 这个常量用 `connect` 把 `Presentational` 组件和 Redux 连接起来。 然后,在`AppWrapper` 中渲染 React Redux 的 `Provider`组件, 给 `Provider` 传入 Redux `store` 属性并渲染 `Container` 为子组件。 Once everything is set up, you will see the messages app rendered to the page again.
+到目前为止,我们的编辑器上已包含了整个章节的代码, 唯一不同的是,React 组件被重新命名为 `Presentational`,即展示层组件。 创建一个新组件,保存在名为 `Container` 的常量中。 这个常量用 `connect` 把 `Presentational` 组件和 Redux 连接起来。 然后,在`AppWrapper` 中渲染 React Redux 的 `Provider`组件, 给 `Provider` 传入 Redux `store` 属性并渲染 `Container` 为子组件。 设置完所有内容后,将再次看到消息应用程序渲染到页面上。
# --hints--
diff --git a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
index 45eef64bfcc..be9f5789bab 100644
--- a/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
+++ b/curriculum/challenges/chinese/05-back-end-development-and-apis/managing-packages-with-npm/add-a-description-to-your-package.json.md
@@ -10,7 +10,7 @@ dashedName: add-a-description-to-your-package-json
一个好的 package.json 文件的下一部分就是 `description` 字段——简短精悍的的项目描述。
-If some day you plan to publish a package to npm, this is the string that should sell your idea to the user when they decide whether to install your package or not. 然而,这并不是使用描述的唯一场景:它也是一种很好的总结项目的方式, 可以帮助其它开发者、维护者甚至自己在未来快速地了解项目,对于任何一个 Node.js 项目来说都非常重要。
+如果有一天你打算向 npm 发布一个软件包,当用户决定是否安装你的软件包时,这个字符串就能向用户表明你的想法。 然而,这并不是使用描述的唯一场景:它也是一种很好的总结项目的方式, 可以帮助其它开发者、维护者甚至自己在未来快速地了解项目,对于任何一个 Node.js 项目来说都非常重要。
无论项目计划是什么,都建议使用描述。 类似这样:
diff --git a/curriculum/challenges/chinese/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md b/curriculum/challenges/chinese/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
index fd4ff61f0bc..135ac0b239a 100644
--- a/curriculum/challenges/chinese/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
+++ b/curriculum/challenges/chinese/09-information-security/information-security-with-helmetjs/ask-browsers-to-access-your-site-via-https-only-with-helmet.hsts.md
@@ -16,7 +16,7 @@ HTTP 严格传输安全(HSTS)是一种网络安全策略,有助于保护
配置 `helmet.hsts()` 以在未来 90 天内使用 HTTPS。 传递配置对象 `{maxAge: timeInSeconds, force: true}`。 你可以创建一个变量 `ninetyDaysInSeconds = 90*24*60*60;` 来用于 `timeInSeconds`。 Replit 已经启用了 hsts。 要覆盖它的设置,你需要在配置对象中把 “force” 字段设置为 true。 我们将拦截并在对其进行检查测试后恢复 Replit 请求头。
-Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and an SSL/TLS Certificate.
+注意:在自定义网站上配置 HTTPS 需要获得一个域名,以及一个 SSL/TLS 证书。
# --hints--
diff --git a/curriculum/challenges/chinese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/chinese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b452d276002..7731f012f88 100644
--- a/curriculum/challenges/chinese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/chinese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
index 92d1c5cd3e4..cc5d44e0c4b 100644
--- a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
+++ b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-accessibility-by-building-a-quiz/6351e7a8684bf5377c4ee7f7.md
@@ -58,7 +58,7 @@ You should give the fourth `label` a `for` attribute.
assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.htmlFor);
```
-You should give the fourth `label` a `for` attribute matching the `id` of its `input` element.
+你应该给第四个 `label` 一个 `for` 属性,以匹配其 `input` 元素的 `id`。
```js
const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[3]?.htmlFor;
diff --git a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
index 973feafdabb..a7100defb1d 100644
--- a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
+++ b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md
@@ -1,31 +1,31 @@
---
id: 63541ef4f96cd82e8e6c788a
-title: Step 12
+title: 步骤 12
challengeType: 0
dashedName: step-12
---
# --description--
-The `method` attribute specifies how to send form-data to the URL specified in the `action` attribute. The form-data can be sent via a `GET` request as URL parameters (with `method="get"`) or via a `POST` request as data in the request body (with `method="post"`).
+`method` 属性指定了如何将表单数据发送到 `action` 属性中指定的 URL。 表单数据可以通过 `GET` 请求作为 URL 参数发送(`method="get"`)或通过 `POST` 请求作为请求正文中的数据发送(`method="post"`)。
-Set the `method` attribute to send your form data via a `POST` request.
+设置 `method` 属性通过 `POST` 请求发送你的表单数据。
# --hints--
-You shouldn't add a new `form` element.
+你不应该添加一个新的 `form` 元素。
```js
assert.equal(document.querySelectorAll('form').length, 1 )
```
-Your `form` element should have a `method` attribute.
+你的 `form` 元素应有一个 `method` 属性。
```js
assert.exists(document.querySelector('form')?.getAttribute('method'));
```
-Your `method` attribute should be set to `post`.
+你的 `method` 属性应设置为 `post`。
```js
assert.equal(document.querySelector('form')?.getAttribute('method'), 'post');
diff --git a/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index 844246919d5..f1da0a28a1a 100644
--- a/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/espanol/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/german/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/german/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b452d276002..7731f012f88 100644
--- a/curriculum/challenges/german/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/german/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/italian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/italian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index 6928f071e72..6eeac4433c1 100644
--- a/curriculum/challenges/italian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/italian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ La struttura dati `MaxHeap` dovrebbe esistere
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/japanese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/japanese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b3fe0799b1f..284636b4e08 100644
--- a/curriculum/challenges/japanese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/japanese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-flexbox-by-building-a-photo-gallery/615380dff67172357fcf0425.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-flexbox-by-building-a-photo-gallery/615380dff67172357fcf0425.md
index ec912df8bd6..5041ab39c54 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-flexbox-by-building-a-photo-gallery/615380dff67172357fcf0425.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-flexbox-by-building-a-photo-gallery/615380dff67172357fcf0425.md
@@ -7,7 +7,7 @@ dashedName: step-7
# --description--
-Normalize your box model by creating a `*` selector and setting the `box-sizing` property to `border-box` as the value.
+ボックスモデルについて、ブラウザによる表示の差異を統一するために、`*` セレクターを作成して `box-sizing` プロパティの値を `border-box` に設定してください。
# --hints--
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-grid-by-building-a-magazine/6143d2842b497779bad947de.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-grid-by-building-a-magazine/6143d2842b497779bad947de.md
index fa4b5f4c141..8172f9efe13 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-grid-by-building-a-magazine/6143d2842b497779bad947de.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-grid-by-building-a-magazine/6143d2842b497779bad947de.md
@@ -7,7 +7,7 @@ dashedName: step-26
# --description--
-CSS を書き始めるために、まず CSS ルールをリセットしましょう。`*` を使用してすべての要素をターゲットにし、`::before` および `::after` 疑似セレクターもそこに含めてください。 `padding` プロパティと `margin` プロパティの両方を `0` に設定してください。
+CSS を書き始めるためにまず、ブラウザによる表示の差異が統一されるように CSS ルールをリセットしましょう。`*` を使用してすべての要素をターゲットにし、`::before` および `::after` 疑似セレクターもそこに含めてください。 `padding` プロパティと `margin` プロパティの両方を `0` に設定してください。
# --hints--
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968df2acd5550bf1616c34.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968df2acd5550bf1616c34.md
index f302711531e..1ee29258a07 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968df2acd5550bf1616c34.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968df2acd5550bf1616c34.md
@@ -7,7 +7,7 @@ dashedName: step-3
# --description--
-Normalise your page's sizing, by removing the `body` element's `margin` and `padding`.
+`body` 要素の `margin` と `padding` を除去することで、異なるブラウザ間のページの表示を統一してください。
# --hints--
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d00a5d7292262bc02f4c.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d00a5d7292262bc02f4c.md
index 0c524143bd3..079fc90b5e2 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d00a5d7292262bc02f4c.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d00a5d7292262bc02f4c.md
@@ -7,11 +7,11 @@ dashedName: step-21
# --description--
-Set the `position` property of the `.back-mountain` to prevent it from taking up space in the page layout.
+`.back-mountain` の `position` プロパティを、ページレイアウトのスペースを占有しないように設定してください。
# --hints--
-You should give `.back-mountain` a `position` of `absolute`.
+`.back-mountain` の `position` を `absolute` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.position, 'absolute');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d0cda039d026f7f78d1e.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d0cda039d026f7f78d1e.md
index e69228121da..f42ebccf4c2 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d0cda039d026f7f78d1e.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d0cda039d026f7f78d1e.md
@@ -7,23 +7,23 @@ dashedName: step-22
# --description--
-Change the stack level of the `.back-mountain` element such that it is directly behind the `.left-mountain` element.
+`.back-mountain` 要素の重ね合わせレベルを変更して、`.left-mountain` 要素のすぐ後ろに置いてください。
# --hints--
-You should use the `z-index` property to change the stack level.
+`z-index` プロパティを使用して重ね合わせレベルを変更する必要があります。
```js
assert.notEmpty(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.zIndex);
```
-You should set the `z-index` property to `1`.
+`z-index` プロパティを `1` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.zIndex, '1');
```
-You should not change the `z-index` of the `.left-mountain` element.
+`.left-mountain` の `z-index` は変更しないでください。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.left-mountain')?.zIndex, '2');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d1ac33c68d27dcda5796.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d1ac33c68d27dcda5796.md
index 28c94e4bede..e1d53436b37 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d1ac33c68d27dcda5796.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d1ac33c68d27dcda5796.md
@@ -7,41 +7,41 @@ dashedName: step-23
# --description--
-Rotate the `.back-mountain` element by `45deg` clockwise. Then, give it a `left` property of `110px`, and a `top` property of `225px`.
+`.back-mountain` 要素を時計回りに `45deg` 回転させてください。 次に `left` プロパティを `110px` に、`top` プロパティを `225px` に設定してください。
# --hints--
-You should use the `transform` property to rotate the element.
+`transform` プロパティを使用して要素を回転させる必要があります。
```js
assert.notEmpty(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.transform);
```
-You should give `.back-mountain` a `transform` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.back-mountain` には `transform` の `--fcc-expected--` を設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.transform, 'rotate(45deg)');
```
-You should give `.back-mountain` a `left` property.
+`.back-mountain` には `left` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.left);
```
-You should give `.back-mountain` a `left` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.back-mountain` の `left` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.left, '110px');
```
-You should give `.back-mountain` a `top` property.
+`.back-mountain` には `top` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.top);
```
-You should give `.back-mountain` a `top` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.back-mountain` の `top` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.back-mountain')?.top, '225px');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d213d99f16287bff22ae.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d213d99f16287bff22ae.md
index cda22ce7cb0..73d04a55c94 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d213d99f16287bff22ae.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d213d99f16287bff22ae.md
@@ -7,23 +7,23 @@ dashedName: step-24
# --description--
-To finish the background, add a sun, by creating a new `div` element immediately after the `.back-mountain` element, and give it the class of `sun`.
+太陽を追加して、背景を完成させましょう。`.back-mountain` 要素の直後に `div` 要素を作成し、そのクラスを `sun` に設定してください。
# --hints--
-You should add a new `div` element to `body`. Expected `--fcc-expected--` `div` elements, but found `--fcc-actual--`.
+`body` に `div` 要素を新たに 1 つ追加する必要があります。 `--fcc-expected--` 個の `div` 要素があるはずですが、`--fcc-actual--` 個となっています。
```js
assert.equal(document.querySelectorAll('body > div')?.length, 5);
```
-You should give the new `div` element a `class` of `sun`.
+新しい `div` 要素の `class` を `sun` に設定する必要があります。
```js
assert.include(document.querySelector('div:not(.back-mountain, .left-mountain, .penguin, .ground)')?.className, 'sun');
```
-You should place the new `div` element immediately after the `.back-mountain` element.
+新しい `div` 要素は `.back-mountain` 要素の直後に置く必要があります。
```js
assert.strictEqual(document.querySelector('div.back-mountain')?.nextElementSibling, document.querySelector('div.sun'));
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d2c0f22ca0293107c048.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d2c0f22ca0293107c048.md
index 1ddc4df75da..923347d8c96 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d2c0f22ca0293107c048.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d2c0f22ca0293107c048.md
@@ -7,29 +7,29 @@ dashedName: step-25
# --description--
-Give the `.sun` element a `width` and `height` of `200px`, and a `background-color` of `yellow`.
+`.sun` 要素の `width` と `height` を `200px` に、また `background-color` を `yellow` に設定してください。
# --hints--
-You should use the `.sun` selector.
+`.sun` セレクターを使用する必要があります。
```js
assert.match(code, /\.sun\s*\{/);
```
-You should give `.sun` a `width` of `200px`.
+`.sun` の `width` を `200px` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.width, '200px');
```
-You should give `.sun` a `height` of `200px`.
+`.sun` の `height` を `200px` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.height, '200px');
```
-You should give `.sun` a `background-color` of `yellow`.
+`.sun` の `background-color` を `yellow` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.backgroundColor, 'yellow');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d32d1340d829f0f6f57d.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d32d1340d829f0f6f57d.md
index 192adfac782..a5d94d74e1d 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d32d1340d829f0f6f57d.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d32d1340d829f0f6f57d.md
@@ -7,17 +7,17 @@ dashedName: step-26
# --description--
-Set the `position` property of the sun to prevent it from taking up space in the page layout, and set the `border-radius` such that the sun's shape is a circle.
+太陽の `position` プロパティを、ページレイアウトのスペースを占有しないように設定してください。また、太陽の形が円になるように `border-radius` を設定してください。
# --hints--
-You should give `.sun` a `position` of `absolute`.
+`.sun` の `position` を `absolute` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.position, 'absolute');
```
-You should give `.sun` a `border-radius` of `50%`.
+`.sun` の `border-radius` を `50%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.borderRadius, '50%');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d41d40bf9b2aaea5d520.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d41d40bf9b2aaea5d520.md
index 77163118580..a6f9281eaf6 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d41d40bf9b2aaea5d520.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6196d41d40bf9b2aaea5d520.md
@@ -7,17 +7,17 @@ dashedName: step-27
# --description--
-Position the sun in the top right corner of the screen such that `75px` of its top and right edges are off screen.
+太陽を、画面の右上、太陽の上端と右端がそれぞれ `75px` ずつ画面外にはみ出る位置に配置してください。
# --hints--
-You should give `.sun` a `top` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.sun` の `top` は `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.top, '-75px');
```
-You should give `.sun` a `right` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.sun` の `right` は `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.sun')?.right, '-75px');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197cff995d03905b0cca8ad.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197cff995d03905b0cca8ad.md
index 7853c2db31f..669ac146945 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197cff995d03905b0cca8ad.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197cff995d03905b0cca8ad.md
@@ -7,25 +7,25 @@ dashedName: step-28
# --description--
-Your penguin will consist of two main sections: the head, and the body.
+これから作るペンギンの 2 つの主なパーツは、頭と体です。
-Within `.penguin`, add two new `div` elements. The first with a `class` of `penguin-head`, and the second with a `class` of `penguin-body`.
+`.penguin` 内に、新しい `div` 要素を 2 つ追加してください。 1 つ目の `class` は `penguin-head`に、2 つ目の `class` は `penguin-body` に設定してください。
# --hints--
-You should add two new `div` elements to `.penguin`. Expected `--fcc-expected--` `.penguin > div` elements, but found `--fcc-actual--`.
+`.penguin` に `div` 要素を新たに 2 つ追加する必要があります。 `.penguin > div` に該当する要素が `--fcc-expected--` 個あるはずですが、`--fcc-actual--` 個となっています。
```js
assert.equal(document.querySelectorAll('.penguin > div')?.length, 2);
```
-You should give the first `div` a `class` of `penguin-head`.
+1 つ目の `div` の `class` を `penguin-head` に設定する必要があります。
```js
assert.include(document.querySelector('.penguin > div:nth-of-type(1)')?.className, 'penguin-head');
```
-You should give the second `div` a `class` of `penguin-body`.
+2 つ目の `div` の `class` を `penguin-body` に設定する必要があります。
```js
assert.include(document.querySelector('.penguin > div:nth-of-type(2)')?.className, 'penguin-body');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197f40a16afea068c7e60c8.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197f40a16afea068c7e60c8.md
index 8dd02e8f3c8..0a2f4f979e5 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197f40a16afea068c7e60c8.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6197f40a16afea068c7e60c8.md
@@ -7,29 +7,29 @@ dashedName: step-29
# --description--
-Change the stack level of the `.penguin` element such that it appears in front of the `.ground` element, and give it a `position` of `relative`.
+`.penguin` 要素の重ね合わせレベルを、`.ground` 要素の手前に表示されるように変更し、さらに `position` を `relative` に設定してください。
# --hints--
-You should use the `z-index` property to change the stack level.
+`z-index` プロパティを使用して重ね合わせレベルを変更する必要があります。
```js
assert.notEmpty(new __helpers.CSSHelp(document).getStyle('.penguin')?.zIndex);
```
-You should give the `.penguin` element a `z-index` of `4`.
+`.penguin` 要素の `z-index` を `4` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin')?.zIndex, '4');
```
-You should give `.penguin` a `position` property.
+`.penguin` には `position` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.penguin')?.position);
```
-You should give `.penguin` a `position` of `relative`.
+`.penguin` の `position` を `relative` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin')?.position, 'relative');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993b72e874e709b8dfd666.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993b72e874e709b8dfd666.md
index fa9f1b1e7f2..8c8cfc103e3 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993b72e874e709b8dfd666.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993b72e874e709b8dfd666.md
@@ -7,29 +7,29 @@ dashedName: step-30
# --description--
-Target the `.penguin-head` element, and give it a `width` half of its parent's, and a `height` of `45%`. Then, set the `background` to a linear gradient at `45deg` starting at `gray`, and ending at `rgb(239, 240, 228)`.
+`.penguin-head` 要素を選択し、その `width` を親要素の幅の半分に、`height` は `45%` に設定してください。 次に、`background` を線形グラデーションに設定してください。`45deg` の角度で、`gray` で始まり `rgb(239, 240, 228)` で終わるようにしてください。
# --hints--
-You should use the `.penguin-head` selector.
+`.penguin-head` セレクターを使用する必要があります。
```js
assert.match(code, /\.penguin-head\s*\{/);
```
-You should give `.penguin-head` a `width` of `50%`.
+`.penguin-head` の `width` を `50%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.width, '50%');
```
-You should give `.penguin-head` a `height` of `45%`.
+`.penguin-head` の `height` を `45%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.height, '45%');
```
-You should give `.penguin-head` a `background` of `linear-gradient(45deg, gray, rgb(239, 240, 228))`.
+`.penguin-head` の `background` を `linear-gradient(45deg, gray, rgb(239, 240, 228))` に設定する必要があります。
```js
assert.include(['linear-gradient(45deg,gray,rgb(239,240,228))', 'rgba(0,0,0,0)linear-gradient(45deg,gray,rgb(239,240,228))repeatscroll0%0%'], new __helpers.CSSHelp(document).getStyle('.penguin-head')?.getPropVal('background', true));
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993cf26a8e0f0a553db223.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993cf26a8e0f0a553db223.md
index 87cf8a7dcb2..5bfd8d54386 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993cf26a8e0f0a553db223.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993cf26a8e0f0a553db223.md
@@ -7,13 +7,13 @@ dashedName: step-31
# --description--
-_Most_ penguins do not have a square head.
+_ほとんどの_ペンギンの頭は四角ではありませんね。
-Give the penguin a slightly oval head by setting the radius of the top corners to `70%` and the radius of the bottom corners to `65%`.
+ペンギンの頭を少し楕円形にするために、上側の角の半径を `70%`、下側の角の半径を `65%` に設定してください。
# --hints--
-You should give `.penguin-head` a `border-radius` of `70% 70% 65% 65%`.
+`.penguin-head` の `border-radius` を `70% 70% 65% 65%` に設定する必要があります。
```js
// Maybe check for individual border-radius properties?
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993dbb35adf30b10d49e38.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993dbb35adf30b10d49e38.md
index 4cb6c1ddf07..2b3c16d5075 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993dbb35adf30b10d49e38.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993dbb35adf30b10d49e38.md
@@ -7,29 +7,29 @@ dashedName: step-32
# --description--
-Target the `.penguin-body` element, and give it a `width` of `53%`, and a `height` of `45%`. Then, set the `background` to a linear gradient at `45deg`, `rgb(134, 133, 133)` from `0%`, `rgb(234, 231, 231)` from `25%`, and `white` from `67%`.
+`.penguin-body` 要素を選択し、`width` を `53%` に、`height` を `45%` に設定してください。 次に、`background` に線形グラデーションを設定してください。`45deg` の角度で、色は `0%` の位置で `rgb(134, 133, 133)`、`25%` からは `rgb(234, 231, 231)`、`67%` からは `white` になるよう設定してください。
# --hints--
-You should use the `.penguin-body` selector.
+`.penguin-body` セレクターを使用する必要があります。
```js
assert.match(code, /\.penguin-body\s*\{/);
```
-You should give `.penguin-body` a `width` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-body` の `width` を `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` となっています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.width, '53%');
```
-You should give `.penguin-body` a `height` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-body` の `height` を `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` となっています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.height, '45%');
```
-You should give `.penguin-body` a `background` of `linear-gradient(45deg, rgb(134, 133, 133) 0%, rgb(234, 231, 231) 25%, white 67%)`.
+`.penguin-body` の `background` を `linear-gradient(45deg, rgb(134, 133, 133) 0%, rgb(234, 231, 231) 25%, white 67%)` に設定する必要があります。
```js
assert.include(['linear-gradient(45deg,rgb(134,133,133)0%,rgb(234,231,231)25%,white67%)', 'rgba(0,0,0,0)linear-gradient(45deg,rgb(134,133,133)0%,rgb(234,231,231)25%,white67%)repeatscroll0%0%'], new __helpers.CSSHelp(document).getStyle('.penguin-body')?.getPropVal('background', true));
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993e9adc9e9a0bb4d28fff.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993e9adc9e9a0bb4d28fff.md
index 115847a6ff2..339461a90df 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993e9adc9e9a0bb4d28fff.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61993e9adc9e9a0bb4d28fff.md
@@ -7,13 +7,13 @@ dashedName: step-33
# --description--
-Another interesting fact about penguins is that they do not have square bodies.
+実はペンギンは、体も四角くないんです。
-Use the `border-radius` property with a value of `80% 80% 100% 100%`, to give the penguin a slightly rounded body.
+`border-radius` プロパティに `80% 80% 100% 100%` の値を設定して、ペンギンの体を少し丸くしましょう。
# --hints--
-You should give `.penguin-body` a `border-radius` of `80% 80% 100% 100%`.
+`.penguin-body` の `border-radius` を `80% 80% 100% 100%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.borderRadius, '80% 80% 100% 100%');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199409834ccaf0d10736596.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199409834ccaf0d10736596.md
index ff6c220de61..acf64e1a4a0 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199409834ccaf0d10736596.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199409834ccaf0d10736596.md
@@ -7,17 +7,17 @@ dashedName: step-34
# --description--
-Target all descendent elements of the `.penguin` element, and give them a `position` of `absolute`.
+`.penguin` 要素の子孫要素をすべて選択し、それらの `position` を `absolute` に設定してください。
# --hints--
-You should use the `.penguin *` selector.
+`.penguin *` セレクターを使用する必要があります。
```js
assert.match(code, /\.penguin\s*\*\s*\{/);
```
-You should give `.penguin *` a `position` of `absolute`.
+`.penguin *` の `position` を `absolute` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin *')?.position, 'absolute');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199429802b7c10dc79ff871.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199429802b7c10dc79ff871.md
index 32953387ce7..43d1e1477f6 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199429802b7c10dc79ff871.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199429802b7c10dc79ff871.md
@@ -7,29 +7,29 @@ dashedName: step-35
# --description--
-Position the `.penguin-head` element `10%` from the top, and `25%` from the left of its parent.
+`.penguin-head` 要素を、親要素の上端から `10%`、左端から `25%` の位置に配置してください。
# --hints--
-You should give `.penguin-head` a `top` property.
+`.penguin-head` には `top` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.top);
```
-You should give `.penguin-head` a `top` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-head` の `top` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.top, '10%');
```
-You should give `.penguin-head` a `left` property.
+`.penguin-head` には `left` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.left);
```
-You should give `.penguin-head` a `left` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-head` の `left` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.left, '25%');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943285a41720e6370d985.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943285a41720e6370d985.md
index a4d0310c2dc..4a3c17865b1 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943285a41720e6370d985.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943285a41720e6370d985.md
@@ -7,29 +7,29 @@ dashedName: step-36
# --description--
-Position the `.penguin-body` element `40%` from the top, and `23.5%` from the left of its parent.
+`.penguin-body` 要素を、親要素の上端から `40%`、左端から `23.5%` の位置に配置してください。
# --hints--
-You should give `.penguin-body` a `top` property.
+`.penguin-body` には `top` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.top);
```
-You should give `.penguin-body` a `top` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-body` の `top` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.top, '40%');
```
-You should give `.penguin-body` a `left` property.
+`.penguin-body` には `left` プロパティが必要です。
```js
assert.isNotEmpty(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.left);
```
-You should give `.penguin-body` a `left` property of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-body` の `left` プロパティは `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body')?.left, '23.5%');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943876b706d0f35c01dbc.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943876b706d0f35c01dbc.md
index 8ecb86fdf86..238cbbdc1f2 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943876b706d0f35c01dbc.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619943876b706d0f35c01dbc.md
@@ -7,17 +7,17 @@ dashedName: step-37
# --description--
-Change the stack level of the `.penguin-head` element such that it appears in front of the `.penguin-body` element.
+`.penguin-head` 要素の重ね合わせレベルを変更して、`.penguin-body` 要素の手前に表示されるようにしてください。
# --hints--
-You should use the `z-index` property to change the stack level.
+`z-index` プロパティを使用して重ね合わせレベルを変更する必要があります。
```js
assert.notEmpty(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.zIndex);
```
-You should give the `.penguin-head` element a `z-index` of `1`.
+`.penguin-head` 要素の `z-index` を `1` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-head')?.zIndex, '1');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199442866286d0ff421a4fc.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199442866286d0ff421a4fc.md
index 5d49f7033f5..e5cdee84733 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199442866286d0ff421a4fc.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/6199442866286d0ff421a4fc.md
@@ -7,17 +7,17 @@ dashedName: step-38
# --description--
-To give the penguin body a crest, create a pseudo-element that is the first child of the `.penguin-body` element. Set the `content` property of the pseudo-element to an empty string.
+To give the penguin body a crest, create a pseudo-element that is the first child of the `.penguin-body` element. その疑似要素の `content` プロパティを空の文字列に設定してください。
# --hints--
-You should use the `.penguin-body::before` selector.
+`.penguin-body::before` セレクターを使用する必要があります。
```js
assert.match(code, /\.penguin-body::before\s*\{/);
```
-You should give `.penguin-body::before` a `content` of `""`.
+`.penguin-body::before` の `content` を `""` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body::before')?.content, '""');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619bcf239fc15905ecd66fce.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619bcf239fc15905ecd66fce.md
index b7daa0af590..40c77a4b8df 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619bcf239fc15905ecd66fce.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619bcf239fc15905ecd66fce.md
@@ -7,11 +7,11 @@ dashedName: step-39
# --description--
-Position the pseudo-element relative to its closest positioned ancestor.
+疑似要素を、直近の位置指定された (positioned) 祖先要素に対して相対配置してください。
# --hints--
-You should give `.penguin-body::before` a `position` of `absolute`.
+`.penguin-body::before` の `position` を `absolute` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body::before')?.position, 'absolute');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619be73b3c806006ccc00bb0.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619be73b3c806006ccc00bb0.md
index 3744bded667..963e7a3f0f6 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619be73b3c806006ccc00bb0.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/619be73b3c806006ccc00bb0.md
@@ -7,23 +7,23 @@ dashedName: step-40
# --description--
-Give the pseudo-element a `width` half that of its parent, a `height` of `45%`, and a `background-color` of `gray`.
+疑似要素の `width` を親要素の幅の半分に、`height` を `45%` に、`background-color` を `gray` に設定してください。
# --hints--
-You should give `.penguin-body::before` a `width` of `50%`.
+`.penguin-body::before` の `width` を `50%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body::before')?.width, '50%');
```
-You should give `.penguin-body::before` a `height` of `45%`.
+`.penguin-body::before` の `height` を `45%` に設定する必要があります。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body::before')?.height, '45%');
```
-You should give `.penguin-body::before` a `background-color` of `--fcc-expected--`, but found `--fcc-actual--`.
+`.penguin-body::before` の `background-color` は `--fcc-expected--` に設定する必要がありますが、`--fcc-actual--` が設定されています。
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.penguin-body::before')?.backgroundColor, 'gray');
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61a8fe15a6a31306e60d1e89.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61a8fe15a6a31306e60d1e89.md
index b5789d151d5..f5211392bbb 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61a8fe15a6a31306e60d1e89.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61a8fe15a6a31306e60d1e89.md
@@ -7,7 +7,7 @@ dashedName: step-4
# --description--
-Normalise your page, by setting the `width` to `100%`, and `height` to `100vh`.
+`width` を `100%` に、`height` を `100vh` に設定することで、異なるブラウザ間のページの表示を統一してください。
# --hints--
diff --git a/curriculum/challenges/portuguese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/portuguese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index b7c58ee98b5..62df300d53b 100644
--- a/curriculum/challenges/portuguese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/portuguese/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ A estrutura de dados `MaxHeap` deve existir.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);
diff --git a/curriculum/challenges/ukrainian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md b/curriculum/challenges/ukrainian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
index d3af667db1c..d862e66a970 100644
--- a/curriculum/challenges/ukrainian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
+++ b/curriculum/challenges/ukrainian/10-coding-interview-prep/data-structures/remove-an-element-from-a-max-heap.md
@@ -27,7 +27,7 @@ The `MaxHeap` data structure should exist.
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
}
@@ -41,7 +41,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -57,7 +57,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -73,7 +73,7 @@ assert(
```js
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -104,7 +104,7 @@ function isHeap(arr, i, n) {
assert(
(function () {
- var test = false;
+ let test = false;
if (typeof MaxHeap !== 'undefined') {
test = new MaxHeap();
} else {
@@ -120,10 +120,16 @@ assert(
return false;
}
const removed = test.remove();
- if(removed > max) return false
+ if (!vals.includes(removed)) return false;
+ if (removed > max) return false
max = removed;
result.push(removed);
}
+ for (let i = 0; i < vals.length; i++) {
+ if (!result.includes(vals[i])) {
+ return false;
+ }
+ }
return true
})()
);
@@ -134,7 +140,7 @@ assert(
## --seed-contents--
```js
-var MaxHeap = function () {
+const MaxHeap = function () {
this.heap = [];
this.parent = index => {
return Math.floor((index - 1) / 2);