diff --git a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index 4710f6775d8..c7674737e86 100644 --- a/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ console.log(arr); # --instructions-- -استخدم destructuring assignment مع rest parameter لأداء `Array.prototype.slice()` بحيث يكون `arr` هو sub-array من الـ array الأصلية `source` مع حذف العنصرين الأولين. +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. # --hints-- -`arr` يجب أن يكون `[3,4,5,6,7,8,9,10]` +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` يجب ان يكون `[1,2,3,4,5,6,7,8,9,10]` +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` لا ينبغي استخدامه. @@ -54,7 +58,7 @@ assert(source.every((v, i) => v === i + 1) && source.length === 10); assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` 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 946c0d778ad..8376e2c5fd3 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,20 +26,24 @@ console.log(arr); # --instructions-- -使用解構賦值以及 rest 操作符來進行和 `Array.prototype.slice()` 相同的操作,使 `arr` 是原數組 `source` 除開前兩個元素的子數組。 +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. # --hints-- -`arr` 應該是 `[3,4,5,6,7,8,9,10]`。 +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` 應該是 `[1,2,3,4,5,6,7,8,9,10]`。 +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` 不應該使用 `Array.slice()`。 @@ -54,7 +58,7 @@ assert(source.every((v, i) => v === i + 1) && source.length === 10); assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` 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 5cb88145629..70a71625c2b 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,20 +26,24 @@ console.log(arr); # --instructions-- -使用解构赋值以及 rest 操作符来进行和 `Array.prototype.slice()` 相同的操作,使 `arr` 是原数组 `source` 除开前两个元素的子数组。 +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. # --hints-- -`arr` 应该是 `[3,4,5,6,7,8,9,10]`。 +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` 应该是 `[1,2,3,4,5,6,7,8,9,10]`。 +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` 不应该使用 `Array.slice()`。 @@ -54,7 +58,7 @@ assert(source.every((v, i) => v === i + 1) && source.length === 10); assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index 32d3af6f7dd..871af779886 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ Las variables `a` y `b` toman el primer y segundo valor del arreglo. Después de # --instructions-- -Utiliza la sintaxis de desestructuración con el parámetro rest para realizar un `Array.prototype.slice()` eficaz, de tal manera que `arr` sea un sub-arreglo del arreglo original `source` con los dos primeros elementos omitidos. +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. # --hints-- -`arr` debe ser `[3,4,5,6,7,8,9,10]` +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` debe ser `[1,2,3,4,5,6,7,8,9,10]` +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` no debe ser usado. @@ -54,7 +58,7 @@ Se debe utilizar desestructuración en `list`. assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.md b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.md index 5ad763acfe9..3cd8d0a3412 100644 --- a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.md +++ b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values.md @@ -15,7 +15,7 @@ Wenn die zu vergleichenden Werte nicht vom gleichen Typ sind, führt der Gleichh **Beispiele** -`3 == '3'` gibt `true` zurück, weil JavaScript eine Typkonvertierung von String zu Zahl durchführt. `3 === '3'` returns `false` because the types are different and type conversion is not performed. +`3 == '3'` gibt `true` zurück, weil JavaScript eine Typkonvertierung von String zu Zahl durchführt. `3 === '3'` gibt `false` zurück, weil die Typen unterschiedlich sind und die Typkonvertierung nicht durchgeführt wird. **Hinweis:** In JavaScript kannst du den Typ einer Variablen oder eines Wertes mit dem `typeof`-Operator bestimmen, und zwar wie folgt: diff --git a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index 1064a0063dd..d377002269a 100644 --- a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ Die Variablen `a` und `b` entnehmen den ersten und zweiten Wert aus dem Array. D # --instructions-- -Verwende die Destrukturierungszuweisung mit dem Rest-Parameter, um ein effektives `Array.prototype.slice()` durchzuführen, so dass `arr` ein Unterarray des ursprünglichen Arrays `source` ist, bei dem die ersten beiden Elemente weggelassen werden. +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. # --hints-- -`arr` sollte `[3,4,5,6,7,8,9,10]` sein +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` sollte `[1,2,3,4,5,6,7,8,9,10]` sein +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` sollte nicht verwendet werden. @@ -54,7 +58,7 @@ Die Destrukturierung auf `list` sollte verwendet werden. assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.md b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.md index 5fa480cd0df..c0c765e4fa8 100644 --- a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.md +++ b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/functional-programming/add-elements-to-the-end-of-an-array-using-concat-instead-of-push.md @@ -17,7 +17,7 @@ const arr = [1, 2, 3]; arr.push(4, 5, 6); ``` -`arr` would have a modified value of `[1, 2, 3, 4, 5, 6]`, which is not the functional programming way. +`arr` hätte nun den modifizierten Wert `[1, 2, 3, 4, 5, 6]`, was nicht dem praktischen Programmierweg entspricht. `concat` offers a way to merge new items to the end of an array without any mutating side effects. diff --git a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.md b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.md index 1f9945eb6ca..76080598c33 100644 --- a/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.md +++ b/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller.md @@ -36,13 +36,13 @@ assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4]); assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4]); ``` -Deine Lösung sollte nicht `Array.prototype.flat()` oder `Array.prototype.flatMap()` Methoden verwenden. +Deine Lösung sollte nicht `Array.prototype.flat()`- oder `Array.prototype.flatMap()`-Methoden verwenden. ```js assert(!code.match(/\.\s*flat\s*\(/) && !code.match(/\.\s*flatMap\s*\(/)); ``` -Global variables should not be used. +Globale Variablen sollten nicht verwendet werden. ```js steamrollArray([1, {}, [3, [[4]]]]) diff --git a/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md b/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md index ed2c2fc285e..ed0115887e8 100644 --- a/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md +++ b/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-drum-machine.md @@ -1,6 +1,6 @@ --- id: 587d7dbc367417b2b2512bae -title: Baue eine Dum Machine +title: Baue eine Schlagzeugmaschine challengeType: 3 forumTopicId: 301370 dashedName: build-a-drum-machine @@ -8,11 +8,11 @@ dashedName: build-a-drum-machine # --description-- -**Objective:** Build an app that is functionally similar to this: https://drum-machine.freecodecamp.rocks/. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://drum-machine.freecodecamp.rocks/ aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. -Du kannst eine beliebige Mischung aus HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux und jQuery verwenden, um dieses Projekt fertigzustellen. Du solltest ein Frontend Framework (wie zum Beispiel React) verwenden, da es in diesem Abschnitt um das Lernen von Frontend Frameworks geht. Zusätzliche Technologien, die oben nicht aufgeführt sind, werden nicht empfohlen und ihre Verwendung erfolgt auf eigene Gefahr. Wir prüfen die Unterstützung anderer Frontend-Frameworks wie Angular und Vue, aber sie werden derzeit nicht unterstützt. Wir werden alle Fehlerberichte akzeptieren und versuchen, sie zu beheben, die den vorgeschlagenen Technologie-Stack für dieses Projekt verwenden. Viel Spaß beim Programmieren! +Du kannst eine beliebige Mischung aus HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux und jQuery verwenden, um dieses Projekt fertigzustellen. Du solltest ein Frontend-Framework (wie zum Beispiel React) verwenden, da es in diesem Abschnitt um das Lernen von Frontend-Frameworks geht. Zusätzliche Technologien, die oben nicht aufgeführt sind, werden nicht empfohlen und ihre Verwendung erfolgt auf eigene Gefahr. Wir prüfen die Unterstützung anderer Frontend-Frameworks wie Angular und Vue, aber sie werden derzeit nicht unterstützt. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Viel Spaß beim Programmieren! **User Story #1:** Ich sollte einen äußeren Container mit einer zugehörigen `id="drum-machine"` sehen, der alle anderen Elemente enthält. diff --git a/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md b/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md index c9b56797963..7bdff22326f 100644 --- a/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md +++ b/curriculum/challenges/german/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator.md @@ -8,7 +8,7 @@ dashedName: build-a-javascript-calculator # --description-- -**Objective:** Build an app that is functionally similar to this: https://javascript-calculator.freecodecamp.rocks/. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://javascript-calculator.freecodecamp.rocks/ aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart.md b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart.md index 43c95fd5e31..0a0d7f26d92 100644 --- a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart.md +++ b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart.md @@ -8,7 +8,7 @@ dashedName: visualize-data-with-a-bar-chart # --description-- -**Objective:** Build an app that is functionally similar to this: https://bar-chart.freecodecamp.rocks. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://bar-chart.freecodecamp.rocks aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-choropleth-map.md b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-choropleth-map.md index 85183e77f8f..7d33abdc3b8 100644 --- a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-choropleth-map.md +++ b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-choropleth-map.md @@ -8,7 +8,7 @@ dashedName: visualize-data-with-a-choropleth-map # --description-- -**Objective:** Build an app that is functionally similar to this: https://choropleth-map.freecodecamp.rocks. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://choropleth-map.freecodecamp.rocks aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-heat-map.md b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-heat-map.md index 98ff88f1079..6e6331b364c 100644 --- a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-heat-map.md +++ b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-heat-map.md @@ -8,7 +8,7 @@ dashedName: visualize-data-with-a-heat-map # --description-- -**Objective:** Build an app that is functionally similar to this: https://heat-map.freecodecamp.rocks. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://heat-map.freecodecamp.rocks aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md index 148fcc4252d..7410f6a5a48 100644 --- a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md +++ b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph.md @@ -8,7 +8,7 @@ dashedName: visualize-data-with-a-scatterplot-graph # --description-- -**Objective:** Build an app that is functionally similar to this: https://scatterplot-graph.freecodecamp.rocks. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://scatterplot-graph.freecodecamp.rocks aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-treemap-diagram.md b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-treemap-diagram.md index 886a34b1eac..b881b5b185a 100644 --- a/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-treemap-diagram.md +++ b/curriculum/challenges/german/04-data-visualization/data-visualization-projects/visualize-data-with-a-treemap-diagram.md @@ -8,7 +8,7 @@ dashedName: visualize-data-with-a-treemap-diagram # --description-- -**Objective:** Build an app that is functionally similar to this: https://treemap-diagram.freecodecamp.rocks. +**Aufgabe:** Erstelle eine Anwendung, die eine ähnliche Funktionalität wie https://treemap-diagram.freecodecamp.rocks aufweist. Erfülle die folgenden User Stories und bestehe alle Tests. Verwende Bibliotheken und APIs deiner Wahl. Gib dem Ganzen deinen persönlichen Stil. diff --git a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md index 77047c25076..e1ee6af8824 100644 --- a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md +++ b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md @@ -108,7 +108,7 @@ async (getUserInput) => { }; ``` -Du kannst eine `GET` Anfrage an `/api/users` stellen, um eine Liste aller Benutzer zu erhalten. +Du kannst eine `GET`-Anfrage an `/api/users` stellen, um eine Liste aller Nutzer zu erhalten. ```js async(getUserInput) => { @@ -121,7 +121,7 @@ async(getUserInput) => { }; ``` -Die `GET` Anfrage an `/api/users` übermittelt ein Array. +Die `GET`-Anfrage an `/api/users` übermittelt ein Array. ```js async(getUserInput) => { @@ -309,7 +309,7 @@ async (getUserInput) => { }; ``` -A `GET` request to `/api/users/:_id/logs` will return the user object with a `log` array of all the exercises added. +Eine `GET`-Anfrage an `/api/users/:_id/logs` wird das Nutzerobjekt mit einem `log`-Array aller hinzugefügten Übungen zurückgeben. ```js async(getUserInput) => { @@ -353,7 +353,7 @@ async(getUserInput) => { }; ``` -Each item in the `log` array that is returned from `GET /api/users/:_id/logs` is an object that should have a `description`, `duration`, and `date` properties. +Jedes Element des `log`-Arrays – das von `GET /api/users/:_id/logs` zurückgegeben wird –, ist ein Objekt, das folgende Eigenschaften haben sollte: `description`, `duration` und `date`. ```js async(getUserInput) => { diff --git a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md index 1334b9eced1..6fde957a4dd 100644 --- a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md +++ b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice.md @@ -8,11 +8,11 @@ dashedName: timestamp-microservice # --description-- -Erstelle eine vollständige JavaScript-Anwendung, die eine ähnliche Funktionalität wie https://timestamp-microservice.freecodecamp.rocks aufweist. Working on this project will involve you writing your code using one of the following methods: +Erstelle eine vollständige JavaScript-Anwendung, die eine ähnliche Funktionalität wie https://timestamp-microservice.freecodecamp.rocks aufweist. Bei der Arbeit an diesem Projekt musst du deinen Code mit einer der folgenden Methoden schreiben: - Klone dieses GitHub-Repo und schließe dein Projekt lokal ab. - Benutze unser Replit-Starter-Projekt, um dein Projekt fertigzustellen. -- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. +- Use a site builder of your choice to complete the project. Achte darauf, alle Dateien aus unserer GitHub-Repo zu integrieren. Wenn du fertig bist, stelle sicher, dass dein Projekt öffentlich zugänglich gehostet ist. Gib dann die URL in das `Solution Link`-Feld ein. Füge optional einen Link zum Quellcode deines Projekts in das `GitHub Link`-Feld ein. @@ -20,7 +20,7 @@ Wenn du fertig bist, stelle sicher, dass dein Projekt öffentlich zugänglich ge # --hints-- -You should provide your own project, not the example URL. +Du solltest dein eigenes Projekt bereitstellen, nicht die Beispiel-URL. ```js (getUserInput) => { diff --git a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md index 7d18a1f5b3f..26d4196db44 100644 --- a/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md +++ b/curriculum/challenges/german/05-back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice.md @@ -8,13 +8,13 @@ dashedName: url-shortener-microservice # --description-- -Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Working on this project will involve you writing your code using one of the following methods: +Build a full stack JavaScript app that is functionally similar to this: https://url-shortener-microservice.freecodecamp.rocks. Bei der Arbeit an diesem Projekt musst du deinen Code mit einer der folgenden Methoden schreiben: - Clone this GitHub repo and complete your project locally. - Use our Replit starter project to complete your project. -- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. +- Use a site builder of your choice to complete the project. Achte darauf, alle Dateien aus unserer GitHub-Repo zu integrieren. -Wenn du fertig bist, stelle sicher, dass dein Projekt öffentlich zugänglich gehostet ist. Then submit the URL to it in the `Solution Link` field. Füge optional einen Link zum Quellcode deines Projekts in das `GitHub Link`-Feld ein. +Wenn du fertig bist, stelle sicher, dass dein Projekt öffentlich zugänglich gehostet ist. Gib dann die URL in das `Solution Link`-Feld ein. Füge optional einen Link zum Quellcode deines Projekts in das `GitHub Link`-Feld ein. # --instructions-- @@ -22,7 +22,7 @@ Wenn du fertig bist, stelle sicher, dass dein Projekt öffentlich zugänglich ge # --hints-- -You should provide your own project, not the example URL. +Du solltest dein eigenes Projekt bereitstellen, nicht die Beispiel-URL. ```js (getUserInput) => { @@ -34,7 +34,7 @@ You should provide your own project, not the example URL. }; ``` -You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Here's an example: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` +You can POST a URL to `/api/shorturl` and get a JSON response with `original_url` and `short_url` properties. Hier siehst du ein Beispiel: `{ original_url : 'https://freeCodeCamp.org', short_url : 1}` ```js async (getUserInput) => { @@ -56,7 +56,7 @@ async (getUserInput) => { }; ``` -When you visit `/api/shorturl/`, you will be redirected to the original URL. +Wenn du `/api/shorturl/` besuchst, wirst du zur ursprünglichen URL weitergeleitet. ```js async (getUserInput) => { @@ -88,7 +88,7 @@ async (getUserInput) => { }; ``` -If you pass an invalid URL that doesn't follow the valid `http://www.example.com` format, the JSON response will contain `{ error: 'invalid url' }` +Wenn du eine ungültige URL angibst, die nicht dem gültigen `http://www.example.com`-Format folgt, wird die JSON-Antwort `{ error: 'invalid url' }` enthalten ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index 7a04670f323..f29f79bdee9 100644 --- a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ Le variabili `a` e `b` prendono il primo e il secondo valore dall'array. Dopodic # --instructions-- -Usa l'assegnazione destrutturante con il parametro di resto per eseguire un efficace `Array.prototype.slice()` in modo che `arr` sia il sottoarray dell'array originale `source` con i primi due elementi omessi. +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. # --hints-- -`arr` dovrebbe essere `[3,4,5,6,7,8,9,10]` +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` dovrebbe essere `[1,2,3,4,5,6,7,8,9,10]` +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` non dovrebbe essere utilizzato. @@ -54,7 +58,7 @@ Si dovrebbe utilizzare la destrutturazione su `list`. assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md b/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md index 7a35df5d74f..cf2de313d93 100644 --- a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md +++ b/curriculum/challenges/italian/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` +La tua espressione regolare `myRegex` dovrebbe restituire `false` per la stringa `FranklinRoosevelt` ```js myRegex.lastIndex = 0; assert(!myRegex.test('FranklinRoosevelt')); ``` -Your regex `myRegex` should return `false` for the string `EleanorRoosevelt` +La tua espressione regolare `myRegex` dovrebbe restituire `false` per la stringa `EleanorRoosevelt` ```js myRegex.lastIndex = 0; assert(!myRegex.test('EleanorRoosevelt')); ``` -You should use `.test()` to test the regex. +Dovresti usare `.test()` per testare l'espressione regolare. ```js assert(code.match(/myRegex.test\(\s*myString\s*\)/)); ``` -Your result should return `true`. +Il tuo risultato dovrebbe restituire `true`. ```js assert(result === true); diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/authentication-strategies.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/authentication-strategies.md index 0e7937850e3..b3334892aab 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/authentication-strategies.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/authentication-strategies.md @@ -10,13 +10,13 @@ dashedName: authentication-strategies Una strategia è un modo di autenticare un utente. Puoi utilizzare una strategia per permettere agli utenti di autenticarsi basandosi su informazioni salvate localmente (se li si fa prima registrare/iscrivere), o da una varietà di fornitori come Google o GitHub. Per questo progetto, usiamo il middleware Passport. Passport fornisce un set di strategie completo che supporta l'autenticazione usando username e password, GitHub, Google, e altri. -`passport-local@~1.0.0` has already been added as a dependency. Add it to your server as follows: +`passport-local@~1.0.0` è già stato aggiunto come dipendenza. Aggiungilo al tuo server come segue: ```javascript const LocalStrategy = require('passport-local'); ``` -Tell passport to **use** an instantiated `LocalStrategy` object with a few settings defined. Make sure this (as well as everything from this point on) is encapsulated in the database connection since it relies on it!: +Comunica a passport di **usare** un oggetto `LocalStrategy` istanziato con alcune impostazioni definite. Assicurati che questo (come tutto da questo punto in poi) sia compreso all'interno della connessione al database dato che si basa su di essa!: ```javascript passport.use(new LocalStrategy((username, password, done) => { @@ -30,13 +30,13 @@ passport.use(new LocalStrategy((username, password, done) => { })); ``` -This is defining the process to use when you try to authenticate someone locally. First, it tries to find a user in your database with the username entered. Then, it checks for the password to match. Finally, if no errors have popped up that you checked for (e.g. an incorrect password), the `user` object is returned and they are authenticated. +Questo definisce il processo da utilizzare quando provi ad autenticare qualcuno localmente. In primo luogo, cerca di trovare un utente nel tuo database con il nome utente inserito. Poi, controlla che la password corrisponda. Infine, se non sono comparsi errori che hai controllato (ad es. una password errata), l'oggetto `user` viene restituito e l'utente viene autenticato. -Many strategies are set up using different settings. Generally, it is easy to set it up based on the README in that strategy's repository. A good example of this is the GitHub strategy where you don't need to worry about a username or password because the user will be sent to GitHub's auth page to authenticate. As long as they are logged in and agree then GitHub returns their profile for you to use. +Molte strategie sono definite utilizzando impostazioni diverse. In generale, è facile configurarlo in base al README nel repository della strategia. Un buon esempio di questo è la strategia GitHub, dove non devi preoccuparti di nome utente e password dal momento che l'utente sarà indirizzato alla pagina di autenticazione di GitHub per autenticarsi. Una volta che è loggato e accetta, GitHub gli restituisce il suo profilo da utilizzare. -In the next step, you will set up how to actually call the authentication strategy to validate a user based on form data. +Nel passo successivo, imposterai il modo in cui chiamare effettivamente la strategia di autenticazione per convalidare un utente sulla base dei dati del modulo. -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- @@ -55,7 +55,7 @@ async (getUserInput) => { } ``` -Passport-local should be correctly required and set up. +Passport-local dovrebbe essere correttamente richiesto e configurato. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/clean-up-your-project-with-modules.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/clean-up-your-project-with-modules.md index a46660ef688..7e9423ec8c8 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/clean-up-your-project-with-modules.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/clean-up-your-project-with-modules.md @@ -24,9 +24,9 @@ Infine, trasferisci tutte le rotte presenti nel tuo server e incollale nei nuovi Continua ad aggiungere percorsi fino a quando non ci saranno più errori e il tuo file server non avrà più neanche una rotta (**ad eccezione della rotta nel blocco catch**)! -Do the same thing in your `auth.js` file with all of the things related to authentication such as the serialization and the setting up of the local strategy and erase them from your server file. Assicurati di aggiungere le dipendenze e invocare `auth(app, myDataBase)` nel server nello stesso punto. +Fai la stessa cosa nel tuo file `auth.js` con tutte le cose relative all'autenticazione come la serializzazione e l'impostazione della strategia locale e cancellali dal file del server. Assicurati di aggiungere le dipendenze e invocare `auth(app, myDataBase)` nel server nello stesso punto. -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out an example of the completed project. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri errori, puoi vedere un esempio del progetto completato qui. # --hints-- diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/communicate-by-emitting.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/communicate-by-emitting.md index c92e6509164..81e13507cc6 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/communicate-by-emitting.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/communicate-by-emitting.md @@ -72,7 +72,7 @@ async (getUserInput) => { } ``` -Your client should be listening for `'user count'` event. +Il tuo client dovrebbe essere in ascolto per eventi di tipo `'user count'`. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/create-new-middleware.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/create-new-middleware.md index ecd9873553f..f75770a9f95 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/create-new-middleware.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/create-new-middleware.md @@ -8,11 +8,11 @@ dashedName: create-new-middleware # --description-- -As is, any user can just go to `/profile` whether they have authenticated or not by typing in the URL. You want to prevent this by checking if the user is authenticated first before rendering the profile page. Questo è l'esempio perfetto di quando conviene creare un middleware. +Attualmente, ogni utente può andare su `/profile` indipendentemente dal fatto che sia autenticato o meno, semplicemente digitando l'URL. Vuoi evitarlo, controllando che l'utente sia autenticato prima di visualizzare la pagina del profilo. Questo è l'esempio perfetto di quando conviene creare un middleware. -The challenge here is creating the middleware function `ensureAuthenticated(req, res, next)`, which will check if a user is authenticated by calling Passport's `isAuthenticated` method on the `request` which checks if `req.user` is defined. If it is, then `next()` should be called. Otherwise, you can just respond to the request with a redirect to your homepage to login. +La sfida consiste nel creare la funzione middleware `ensureAuthenticated(req, res, next)`, che controlla se un utente è autenticato o meno invocando il metodo di Passport `isAuthenticated` su `request`, che controlla se `req.user` è definito. Se lo è, allora `next()` dovrebbe essere chiamata. Altrimenti, puoi solo rispondere alla richiesta con un reindirizzamento alla tua homepage per effettuare il login. -An implementation of this middleware is: +Una implementazione di questo middleware è: ```javascript function ensureAuthenticated(req, res, next) { @@ -23,7 +23,7 @@ function ensureAuthenticated(req, res, next) { }; ``` -Create the above middleware function, then pass `ensureAuthenticated` as middleware to requests for the profile page before the argument to the GET request: +Crea la funzione middleware qui sopra, poi passa `ensureAuthenticated` come middleware per le richieste per la pagina di profilo prima dell'argomento della richiesta GET: ```javascript app @@ -33,11 +33,11 @@ app }); ``` -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- -The middleware `ensureAuthenticated` should be implemented and attached to the `/profile` route. +Il middleware `ensureAuthenticated` dovrebbe essere implementato e associato alla rotta `/profile`. ```js async (getUserInput) => { @@ -57,7 +57,7 @@ async (getUserInput) => { } ``` -An unauthenticated GET request to `/profile` should correctly redirect to `/`. +Una richiesta GET non autenticata a `/profile` dovrebbe reindirizzare correttamente a `/`. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md index a814b01e44d..bb49aee9cff 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/handle-a-disconnect.md @@ -18,11 +18,11 @@ socket.on('disconnect', () => { }); ``` -To make sure clients continuously have the updated count of current users, you should decrease `currentUsers` by 1 when the disconnect happens then emit the `'user count'` event with the updated count. +Per assicurarti che i client continuino ad avere il numero aggiornato degli utenti connessi, quando avviene una disconnessione dovresti diminuire `currentUsers` di 1 ed emettere l'evento `'user count'` con il conteggio aggiornato. **Nota:** Proprio come `'disconnect'`, tutti gli altri eventi che un socket può emettere sul server devono essere gestiti all'interno del listener di connessione dove abbiamo definito 'socket'. -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- @@ -37,7 +37,7 @@ async (getUserInput) => { } ``` -Your client should be listening for `'user count'` event. +Il tuo client dovrebbe essere in ascolto per eventi di tipo `'user count'`. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md index 028d511e4e7..8172fbfd300 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/how-to-use-passport-strategies.md @@ -8,23 +8,23 @@ dashedName: how-to-use-passport-strategies # --description-- -In the `index.pug` file supplied, there is a login form. It is hidden because of the inline JavaScript `if showLogin` with the form indented after it. +Nel file `index.pug` fornito, c'è un modulo di login. È nascosto a causa del JavaScript in linea `if showLogin` con il modulo indentato dopo di esso. -In the `res.render` for that page, add a new variable to the object, `showLogin: true`. When you refresh your page, you should then see the form! This form is set up to **POST** on `/login`. So, this is where you should set up to accept the POST request and authenticate the user. +Nel `res.render` per quella pagina, aggiungi una nuova variabile all'oggetto, `showLogin: true`. Quando aggiorni la pagina, dovresti vedere il modulo! Questo modulo è impostato con **POST** su `/login`. Quindi, è qui che dovresti agire per accettare la richiesta POST e autenticare l'utente. -For this challenge, you should add the route `/login` to accept a POST request. To authenticate on this route, you need to add a middleware to do so before then sending a response. This is done by just passing another argument with the middleware before with your response. The middleware to use is `passport.authenticate('local')`. +Per questa sfida, dovresti aggiungere la rotta `/login` per accettare una richiesta POST. Per autenticarsi su questa rotta, è necessario aggiungere un middleware per farlo prima di inviare una risposta. Questo viene fatto semplicemente passando un altro argomento con il middleware prima della tua risposta. Il middleware da usare è `passport.authenticate('local')`. -`passport.authenticate` can also take some options as an argument such as `{ failureRedirect: '/' }` which is incredibly useful, so be sure to add that in as well. Add a response after using the middleware (which will only be called if the authentication middleware passes) that redirects the user to `/profile`. Add that route, as well, and make it render the view `profile.pug`. +`passport.authenticate` può anche prendere alcune opzioni come un argomento tipo `{ failureRedirect: '/' }` che è incredibilmente utile, quindi assicurati di aggiungere anche quello. Aggiungi una risposta dopo aver usato il middleware (che verrà chiamata solo se il middleware di autenticazione passa) che reindirizza l'utente su `/profile`. Aggiungi anche questa rotta e fa' sì che presenti la vista `profile.pug`. -If the authentication was successful, the user object will be saved in `req.user`. +Se l'autenticazione è riuscita, l'oggetto utente verrà salvato in `req.user`. -At this point, if you enter a username and password in the form, it should redirect to the home page `/`, and the console of your server should display `'User {USERNAME} attempted to log in.'`, since we currently cannot login a user who isn't registered. +A questo punto, se inserisci un nome utente e una password nel modulo, dovresti essere reindirizzato alla home page `/`, e la console del tuo server dovrebbe mostrare `'User {USERNAME} attempted to log in.'`, dato che al momento non possiamo effettuare il login di un utente che non è registrato. -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- -All steps should be correctly implemented in `server.js`. +Tutti i passaggi dovrebbero essere correttamente implementati nel `server.js`. ```js async (getUserInput) => { @@ -49,7 +49,7 @@ async (getUserInput) => { } ``` -A POST request to `/login` should correctly redirect to `/`. +Una richiesta POST a `/login` dovrebbe reindirizzare correttamente a `/`. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implement-the-serialization-of-a-passport-user.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implement-the-serialization-of-a-passport-user.md index 216354914c1..f6e00706571 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implement-the-serialization-of-a-passport-user.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implement-the-serialization-of-a-passport-user.md @@ -8,11 +8,11 @@ dashedName: implement-the-serialization-of-a-passport-user # --description-- -You are not loading an actual user object since the database is not set up. Connect to the database once, when you start the server, and keep a persistent connection for the full life-cycle of the app. To do this, add your database's connection string (for example: `mongodb+srv://:@cluster0-jvwxi.mongodb.net/?retryWrites=true&w=majority`) to the environment variable `MONGO_URI`. Questo è usato nel file `connection.js`. +Non stai caricando un vero e proprio oggetto utente poiché il database non è configurato. Connettiti al database una volta, quando avvii il server, e mantieni una connessione continua per l'intero ciclo di vita dell'app. Per fare questo, aggiungi la stringa di connessione del database (per esempio: `mongodb+srv://:@cluster0-jvwxi.mongodb.net/?retryWrites=true&w=majority`) alla variabile di ambiente `MONGO_URI`. Questo è usato nel file `connection.js`. -*If you are having issues setting up a free database on MongoDB Atlas, check out this tutorial.* +*Se stai avendo problemi a impostare un database gratuito con MongoDB Atlas, vedi questo tutorial.* -Now you want to connect to your database, then start listening for requests. The purpose of this is to not allow requests before your database is connected or if there is a database error. To accomplish this, encompass your serialization and app routes in the following code: +Ora vuoi connetterti al tuo database e metterti in ascolto delle richieste. Lo scopo è di non permettere richieste prima che il database sia connesso o nel caso ci sia un errore del database. Per farlo, includi la tua serializzazione e le rotte della app nel seguente codice: ```javascript myDB(async client => { @@ -40,7 +40,7 @@ myDB(async client => { Assicurati di decommentare il codice di `myDataBase` in `deserializeUser`, e modifica il tuo `done(null, null)` per includere il `doc`. -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication-iii.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication-iii.md index 7098a80742a..e594cba2adc 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication-iii.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication-iii.md @@ -41,9 +41,9 @@ myDataBase.findOneAndUpdate( `findOneAndUpdate` ti permette di cercare un oggetto e aggiornarlo. Se l'oggetto non esiste, verrà inserito e reso disponibile alla funzione di callback. In questo esempio, abbiamo sempre impostato `last_login`, incrementato il `login_count` di `1`, e popolato la maggior parte dei campi solo quando viene inserito un nuovo oggetto (nuovo utente). Nota l'uso dei valori predefiniti. A volte un profilo restituito non avrà tutte le informazioni compilate o l'utente lo manterrà privato. Dovrai gestire questo caso per evitare un errore. -You should be able to login to your app now. Try it! +Ora dovresti essere in grado di accedere alla tua app. Provala! -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.md index e942115e066..9f177fc3a5f 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.md @@ -10,21 +10,21 @@ dashedName: implementation-of-social-authentication Il percorso di base che seguirà questo tipo di autenticazione nella tua app è: -1. User clicks a button or link sending them to your route to authenticate using a specific strategy (e.g. GitHub). -2. La tua rotta chiama `passport.authenticate('github')` che li reindirizza a GitHub. -3. La pagina su cui l'utente atterra, su GitHub, permette loro di effettuare il login se non sono già loggati. It then asks them to approve access to their profile from your app. -4. The user is then returned to your app at a specific callback url with their profile if they are approved. +1. L'utente fa clic su un pulsante o link che lo reindirizza alla tua rotta per autenticarsi utilizzando una strategia specifica (ad esempio GitHub). +2. La tua rotta chiama `passport.authenticate('github')` che lo reindirizza a GitHub. +3. La pagina su cui arriva l'utente, su GitHub, gli permette di effettuare il login se non è già loggato. Poi gli chiede di approvare l'accesso al suo profilo dalla tua app. +4. L'utente viene quindi rimandato alla tua app a uno specifico url di callback con il suo profilo, se è approvato. 5. Ora è autenticato, e la tua app dovrebbe controllare se si tratta di un profilo che è tornato, o salvarlo nel tuo database se non lo è. -Le strategie con OAuth richiedono di avere almeno un *ID client* e un *Client Secret* che è un modo per il servizio di verificare da chi proviene la richiesta di autenticazione e se è valida. Questi sono ottenuti dal sito con cui si sta tentando di implementare l'autenticazione, ad esempio GitHub, e sono unici per la tua app--**NON DEVONO ESSERE CONDIVISI** e non dovrebbero mai essere caricati in un archivio pubblico o scritti direttamente nel tuo codice. Una pratica comune è metterli nel tuo file `.env` e fare riferimento a loro in questo modo: `process.env.GITHUB_CLIENT_ID`. For this challenge you are going to use the GitHub strategy. +Le strategie con OAuth richiedono di avere almeno un *ID client* e un *Client Secret* che è un modo per il servizio di verificare da chi proviene la richiesta di autenticazione e se è valida. Questi sono ottenuti dal sito con cui si sta tentando di implementare l'autenticazione, ad esempio GitHub, e sono unici per la tua app--**NON DEVONO ESSERE CONDIVISI** e non dovrebbero mai essere caricati in un archivio pubblico o scritti direttamente nel tuo codice. Una pratica comune è metterli nel tuo file `.env` e fare riferimento a loro in questo modo: `process.env.GITHUB_CLIENT_ID`. Per questa sfida userai la strategia GitHub. -Follow these instructions to obtain your *Client ID and Secret* from GitHub. Go to your GitHub profile settings and click 'developer settings', then 'OAuth Apps'. Click 'New OAuth App', then give your app a name, paste in the URL to your Replit homepage (**Not the project code's url**) and, for the callback URL, paste in the same URL as the homepage but add `/auth/github/callback` to the end of it. This is where users will be redirected after authenticating on GitHub. After you do all that, click 'Register application'. +Segui questa strategia per ottenere *Client ID e Segreto* da GitHub. Vai sulle impostazioni del tuo profilo GitHub e clicca su 'developer settings', poi su 'OAuth Apps'. Clicca su 'New OAuth App', poi dai un nome alla tua app, incolla l'URL alla tua home page Replit (**Non l'url al codice del progetto**) e, per l'URL di callback, incolla lo stesso URL dell'home page ma aggiungi `/auth/github/callback` alla sua fine. È qui che gli utenti verranno reindirizzati dopo l'autenticazione su GitHub. Dopo aver fatto tutto questo, clicca su 'Register application'. -On the next page, click 'Generate a new client secret' to create a new client secret. Save the client ID and your client secret in your project's `.env` file as `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`. +Nella pagina successiva, clicca su 'Generate a new client secret' per creare un nuovo segreto client. Salva l'ID client e il tuo segreto client nel file `.env` del tuo progetto come `GITHUB_CLIENT_ID` e `GITHUB_CLIENT_SECRET`. -In your `routes.js` file, add `showSocialAuth: true` to the homepage route, after `showRegistration: true`. Now, create 2 routes accepting GET requests: `/auth/github` and `/auth/github/callback`. The first should only call passport to authenticate `'github'`. The second should call passport to authenticate `'github'` with a failure redirect to `/`, and then if that is successful redirect to `/profile` (similar to your last project). +Nel tuo file `routes.js`, aggiungi `showSocialAuth: true` alla rotta homepage, dopo `showRegistration: true`. Ora, crea 2 rotte che accettano le richieste GET: `/auth/github` e `/auth/github/callback`. La prima dovrebbe chiamare solo passport per autenticare `'github'`. La seconda dovrebbe chiamare passport per autenticare `'github'` con un reindirizzamento fallito a `/`, e poi, se questo è riuscito, reindirizzare a `/profile` (simile al tuo ultimo progetto). -An example of how `/auth/github/callback` should look is similar to how you handled a normal login: +Un esempio di come `/auth/github/callback` deve essere è simile al modo in cui hai gestito un normale login: ```js app.route('/login') @@ -33,11 +33,11 @@ app.route('/login') }); ``` -Submit your page when you think you've got it right. If you're running into errors, you can check out the project up to this point. +Invia la tua pagina quando pensi che sia tutto corretto. Se incontri degli errori, puoi vedere il progetto fino a questo punto. # --hints-- -Route `/auth/github` should be correct. +La rotta `/auth/github` dovrebbe essere corretta. ```js async (getUserInput) => { @@ -68,7 +68,7 @@ async (getUserInput) => { } ``` -Route `/auth/github/callback` should be correct. +La rotta `/auth/github/callback` dovrebbe essere corretta. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/registration-of-new-users.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/registration-of-new-users.md index 012affaf40a..750a66b8754 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/registration-of-new-users.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/registration-of-new-users.md @@ -8,20 +8,20 @@ dashedName: registration-of-new-users # --description-- -Now you need to allow a new user on your site to register an account. In the `res.render` for the home page add a new variable to the object passed along - `showRegistration: true`. When you refresh your page, you should then see the registration form that was already created in your `index.pug` file. This form is set up to **POST** on `/register`, so create that route and have it add the user object to the database by following the logic below. +Ora devi permettere a un nuovo utente di creare un account sul tuo sito. Su `res.render` per l'home page aggiungi una nuova variabile all'oggetto passato - `showRegistration: true`. Quando aggiorni la pagina, dovresti vedere un modulo di registrazione che era già stato creato nel file `index.pug`. Questo modulo è impostato con **POST** su `/register`, quindi crea questa rotta e fa' sì che aggiunga l'oggetto user al database seguendo la logica qui sotto. -The logic of the registration route should be as follows: +La logica della rotta di registrazione dovrebbe essere la seguente: -1. Register the new user -2. Authenticate the new user -3. Redirect to `/profile` +1. Registra il nuovo utente +2. Autentica il nuovo utente +3. Reindirizza a `/profile` -The logic of step 1 should be as follows: +La logica della fase 1 dovrebbe essere la seguente: -1. Query database with `findOne` -2. If there is an error, call `next` with the error -3. If a user is returned, redirect back to home -4. If a user is not found and no errors occur, then `insertOne` into the database with the username and password. As long as no errors occur there, call `next` to go to step 2, authenticating the new user, which you already wrote the logic for in your `POST /login` route. +1. Esegui una query nel database con `findOne` +2. Se c'è un errore, chiama `next` con l'errore +3. Se viene restituito un utente, reindirizza alla home +4. Se un utente non viene trovato e non si verificano errori, usa `insertOne` nel database con il nome utente e la password. Finché non si verificano errori, chiama `next` per andare alla fase 2, autenticando il nuovo utente, per cui hai già scritto la logica nella rotta `POST /login`. ```js app.route('/register') @@ -56,13 +56,13 @@ app.route('/register') ); ``` -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. **NOTA:** Da questo punto in poi, possono sorgere problemi relativi all'uso del browser *picture-in-picture*. Se stai utilizzando un IDE online che offre una preview dell'app nell'editor, è raccomandato aprire la preview in una nuova scheda. # --hints-- -You should have a `/register` route and display a registration form on the home page. +Dovresti avere una rotta `/register` e visualizzare un modulo di registrazione sulla home page. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md index 27b589c066a..71e7ee3c07f 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/serialization-of-a-user-object.md @@ -10,20 +10,20 @@ dashedName: serialization-of-a-user-object La serializzazione e la deserializzazione sono concetti importanti per quanto riguarda l'autenticazione. Serializzare un oggetto significa convertire il suo contenuto in una piccola *chiave* (key) che può essere deserializzata nell'oggetto originale. Questo ci permette di sapere chi ha comunicato con il server senza dover inviare i dati di autenticazione, come il nome utente e la password, ad ogni richiesta di una nuova pagina. -To set this up properly, you need to have a serialize function and a deserialize function. In Passport, these can be created with: +Per una configurazione corretta, devi avere una funzione di serializzazione e una funzione di deserializzazione. In Passport, possono essere create con: ```javascript passport.serializeUser(cb); passport.deserializeUser(cb); ``` -The callback function passed to `serializeUser` is called with two arguments: the full user object, and a callback used by passport. +La funzione callback passata a `serializeUser` viene chiamata con due argomenti: l'oggetto utente completo e un callback utilizzato da passport. -The callback expects two arguments: An error, if any, and a unique key to identify the user that should be returned in the callback. You will use the user's `_id` in the object. This is guaranteed to be unique, as it is generated by MongoDB. +Il callback accetta due argomenti: Un errore, se presente, e una chiave univoca per identificare l'utente che dovrebbe essere restituito nel callback. Utilizzerai l'`_id` dell'utente nell'oggetto. È garantito che sia unico, dato che è generato da MongoDB. -Similarly, `deserializeUser` is called with two arguments: the unique key, and a callback function. +Analogamente, `deserializeUser` è chiamata con due argomenti: la chiave unica e una funzione callback. -This callback expects two arguments: An error, if any, and the full user object. To get the full user object, make a query search for a Mongo `_id`, as shown below: +Questo callback accetta due argomenti: Un errore, se presente, e l'oggetto utente completo. Per ottenere un oggetto utente completo, effettua una ricerca query per un `_id` Mongo, come mostrato di seguito: ```javascript @@ -38,19 +38,19 @@ passport.deserializeUser((id, done) => { }); ``` -Add the two functions above to your server. The `ObjectID` class comes from the `mongodb` package. `mongodb@~3.6.0` has already been added as a dependency. Declare this class with: +Aggiungi le due funzioni sopra al tuo server. La classe `ObjectID` proviene dal pacchetto `mongodb`. `mongodb@~3.6.0` è già stato aggiunto come dipendenza. Dichiara questa classe con: ```javascript const { ObjectID } = require('mongodb'); ``` -The `deserializeUser` will throw an error until you set up the database connection. So, for now, comment out the `myDatabase.findOne` call, and just call `done(null, null)` in the `deserializeUser` callback function. +`deserializeUser` darà errore finché non imposti una connessione al database. Quindi, per ora, trasforma la chiamata `myDatabase.findOne` in un commento e chiama `done(null, null)` nella funzione callback `deserializeUser`. -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi che sia tutto corretto. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- -You should serialize user function correctly. +Dovresti serializzare correttamente la funzione user. ```js async (getUserInput) => { @@ -70,7 +70,7 @@ async (getUserInput) => { } ``` -You should deserialize user function correctly. +Dovresti deserializzare correttamente la funzione user. ```js async (getUserInput) => { @@ -90,7 +90,7 @@ async (getUserInput) => { } ``` -MongoDB should be a dependency. +MongoDB dovrebbe essere una dipendenza. ```js async (getUserInput) => { @@ -105,7 +105,7 @@ async (getUserInput) => { } ``` -Mongodb should be properly required including the ObjectId. +Mongodb dovrebbe essere richiesto correttamente, includendo l'ObjectId. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-a-template-engine.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-a-template-engine.md index d1a416f7b07..88100b04054 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-a-template-engine.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-a-template-engine.md @@ -20,19 +20,19 @@ Un modello di motore ti permette di utilizzare file di template statici (come qu `pug@~3.0.0` è già stato installato ed elencato come dipendenza nel file `package.json`. -Express deve sapere quale templare engine si sta utilizzando. Use the `set` method to assign `pug` as the `view engine` property's value: +Express deve sapere quale templare engine si sta utilizzando. Usa il metodo `set` per assegnare `pug` come valore della proprietà `view engine`: ```javascript app.set('view engine', 'pug'); ``` -After that, add another `set` method that sets the `views` property of your `app` to point to the `./views/pug` directory. This tells Express to render all views relative to that directory. +Dopodiché, aggiungi un altro metodo `set` che imposta la proprietà `views` della tua `app` in modo da puntare alla cartella `./views/pug`. Ciò dice a Express di presentare tutte le visualizzazioni relative a questa directory. -Finally, use `res.render()` in the route for your home page, passing `index` as the first argument. This will render the `pug` template. +Infine, usa `res.render()` nella rotta per la tua home page, passando `index` come primo argomento. Questo presenterà il modello `pug`. -If all went as planned, your app home page will no longer be blank. Instead, it will display a message indicating you've successfully rendered the Pug template! +Se tutto è andato come previsto, l'home page dell'app non sarà più vuota. Invece, verrà visualizzato un messaggio che indica che hai presentato con successo il modello di Pug! -Invia la tua pagina quando pensi che sia corretto. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi che sia corretto. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- @@ -62,7 +62,7 @@ async (getUserInput) => { } ``` -You should set the `views` property of the application to `./views/pug`. +Dovresti impostare la proprietà `views` dell'applicazione su `./views/pug`. ```js async (getUserInput) => { @@ -73,7 +73,7 @@ async (getUserInput) => { } ``` -Use the correct ExpressJS method to render the index page from the response. +Utilizza il metodo ExpressJS corretto per visualizzare la pagina index dalla risposta. ```js async (getUserInput) => { @@ -88,7 +88,7 @@ async (getUserInput) => { } ``` -Pug should be working. +Pug dovrebbe funzionare. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-the-environment.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-the-environment.md index 6fd3560915d..840022772eb 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-the-environment.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/set-up-the-environment.md @@ -19,7 +19,7 @@ const io = require('socket.io')(http); Ora che il server *http* è montato sull'app *express*, devi rimanere in ascolto dal server *http*. Cambia la riga con `app.listen` a `http.listen`. -La prima cosa che deve essere gestita è l'ascolto di una nuova connessione dal client. La parola chiave on fa proprio questo: ascolta un evento specifico. Richiede 2 argomenti: una stringa contenente il titolo dell'evento emesso, e una funzione con cui i dati vengono trasmessi. In the case of our connection listener, use `socket` to define the data in the second argument. Un socket è un singolo client che è connesso. +La prima cosa che deve essere gestita è l'ascolto di una nuova connessione dal client. La parola chiave on fa proprio questo: ascolta un evento specifico. Richiede 2 argomenti: una stringa contenente il titolo dell'evento emesso, e una funzione con cui i dati vengono trasmessi. Nel caso del nostro listener di connessione, usa `socket` per definire i dati nel secondo argomento. Un socket è un singolo client che è connesso. Per rimanere in ascolto di connessioni al server, aggiungi quanto segue nella connessione al database: @@ -36,13 +36,13 @@ Ora affinché il client si connetta, devi solo aggiungere quanto segue al tuo `c let socket = io(); ``` -Il commento sopprime l'errore che normalmente vedresti poiché 'io' non è definito nel file. You have already added a reliable CDN to the Socket.IO library on the page in `chat.pug`. +Il commento sopprime l'errore che normalmente vedresti poiché 'io' non è definito nel file. Hai già aggiunto un CDN affidabile alla libreria Socket.IO sulla pagina in `chat.pug`. -Now try loading up your app and authenticate and you should see in your server console `A user has connected`. +Ora prova a caricare la tua app e ad autenticarti: dovresti vedere nella console del tuo server `A user has connected`. **Nota:**`io()` funziona solo quando ci si connette a un socket ospitato sullo stesso url/server. Per connettersi ad un socket esterno ospitato altrove, si utilizzerebbe `io.connect('URL');`. -Invia la tua pagina quando pensi di averlo fatto correttamente. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi vedere il progetto completato fino a questo punto. # --hints-- diff --git a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.md b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.md index 15e28b799e2..9dbba5353c2 100644 --- a/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.md +++ b/curriculum/challenges/italian/06-quality-assurance/advanced-node-and-express/use-a-template-engines-powers.md @@ -12,9 +12,9 @@ Una delle maggiori caratteristiche dell'utilizzo di un template engine è essere Nel tuo file Pug, sei in grado di usare una variabile facendo riferimento al nome della variabile come `#{variable_name}` inline con un altro testo su un elemento o usando un segno uguale sull'elemento senza uno spazio come `p=variable_name` che assegna il valore della variabile al testo dell'elemento p. -Pug is all about using whitespace and tabs to show nested elements and cutting down on the amount of code needed to make a beautiful site. +Pug utilizza spazi e tab per mostrare elementi annidati e tagliare sulla quantità di codice necessario per fare un bel sito. -Take the following Pug code for example: +Prendi il seguente codice Pug come esempio: ```pug head @@ -27,7 +27,7 @@ body p Get on it! ``` -The above yields the following HTML: +Quanto sopra restituisce il seguente HTML: ```html @@ -40,23 +40,23 @@ The above yields the following HTML: ``` -Your `index.pug` file included in your project, uses the variables `title` and `message`. +Il tuo file `index.pug` incluso nel tuo progetto, usa le variabili `title` e `message`. -Pass those from your server to the Pug file by adding an object as a second argument to your `res.render` call with the variables and their values. Give the `title` a value of `Hello` and `message` a value of `Please log in`. +Passa quelle variabili dal tuo server al file Pug aggiungendo un oggetto come secondo argomento alla chiamata `res.render` con le variabili e i loro valori. Dai a `title` il valore `Hello` e a `message` il valore `Please log in`. -It should look like: +Dovrebbe avere questo aspetto: ```javascript res.render('index', { title: 'Hello', message: 'Please log in' }); ``` -Now refresh your page, and you should see those values rendered in your view in the correct spot as laid out in your `index.pug` file! +Ora aggiorna la pagina e dovresti essere in grado di vedere quei valori presentati nel punto corretto come stabilito nel file `index.pug`! -Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point. +Invia la tua pagina quando pensi che sia tutto corretto. Se incontri errori, puoi vedere il progetto completato fino a questo punto. # --hints-- -Pug should correctly render variables. +Pug dovrebbe visualizzare correttamente le variabili. ```js async (getUserInput) => { diff --git a/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968e9243a4090cc805531c.md b/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968e9243a4090cc805531c.md index ec42f168032..fcea9191a75 100644 --- a/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968e9243a4090cc805531c.md +++ b/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-transforms-by-building-a-penguin/61968e9243a4090cc805531c.md @@ -7,11 +7,11 @@ dashedName: step-5 # --description-- -Remove both the horizontal and vertical scrollbars, using only one property. +Rimuovi sia la barra di scorrimento orizzontale che verticale, utilizzando una sola proprietà. # --hints-- -You should give `body` an `overflow` of `--fcc-expected--`. But found `--fcc-actual--`. +Dovresti dare all'elemento `body` una proprietà `overflow` con il valore `--fcc-expected--`. Valore trovato `--fcc-actual--`. ```js assert.equal(new __helpers.CSSHelp(document).getStyle('body')?.overflow, 'hidden'); diff --git a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md index 3ff06331ae8..524fecbe261 100644 --- a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md +++ b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md @@ -47,7 +47,7 @@ Il testo dell'elemento `h1` dovrebbe essere `CatPhotoApp`. Hai omesso il testo, assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp'); ``` -You appear to be using a browser extension that is modifying the page. Be sure to turn off all browser extensions. +Sembra che tu stia usando un'estensione del browser che sta modificando la pagina. Assicurati di disattivare tutte le estensioni del browser. ```js assert.isAtMost(document.querySelectorAll('script').length, 2); diff --git a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md index 973feafdabb..73ba3527911 100644 --- a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md +++ b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/63541ef4f96cd82e8e6c788a.md @@ -7,25 +7,25 @@ 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"`). +L'attributo `method` specifica come inviare il modulo dati all'URL specificato nell'attributo `action`. Il modulo dati può essere inviato tramite richiesta `GET` come parametri URL (con `method="get"`) o tramite una richiesta `POST` come dati nel corpo della richiesta (con `method="post"`). -Set the `method` attribute to send your form data via a `POST` request. +Imposta l'attributo `method` per inviare il modulo dati tramite richiesta `POST`. # --hints-- -You shouldn't add a new `form` element. +Dovresti aggiungere un nuovo elemento `form`. ```js assert.equal(document.querySelectorAll('form').length, 1 ) ``` -Your `form` element should have a `method` attribute. +L'elemento `form` dovrebbe avere un attributo `method`. ```js assert.exists(document.querySelector('form')?.getAttribute('method')); ``` -Your `method` attribute should be set to `post`. +L'attributo `method` dovrebbe essere impostato su `post`. ```js assert.equal(document.querySelector('form')?.getAttribute('method'), 'post'); diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8eff21c0b0f6ebe5b8e38.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8eff21c0b0f6ebe5b8e38.md index 5fc482d5a9c..5b1f7931ff6 100644 --- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8eff21c0b0f6ebe5b8e38.md +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8eff21c0b0f6ebe5b8e38.md @@ -29,13 +29,13 @@ Il quinto valore di `locations` dovrebbe avere una proprietà `name` con il valo assert.equal(locations[4].name, 'kill monster'); ``` -Your fifth `locations` value should have a `button text` array with three `Go to town square` strings. +Il quinto valore di `locations` dovrebbe avere un array `button text` con tre stringhe `Go to town square`. ```js assert.deepEqual(locations[4]["button text"], ['Go to town square', 'Go to town square', 'Go to town square']); ``` -Your fifth `locations` value should have a `button functions` array with three `goTown` variables. +Il quinto valore di `locations` dovrebbe avere un array `button functions` con tre variabili `goTown`. ```js assert.deepEqual(locations[4]["button functions"], [goTown, goTown, goTown]); diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a94114ce0b8918b487390f.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a94114ce0b8918b487390f.md index fdc09872293..e2d12bec4b6 100644 --- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a94114ce0b8918b487390f.md +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a94114ce0b8918b487390f.md @@ -29,13 +29,13 @@ Il settimo valore di `locations` dovrebbe avere una proprietà `name` con il val assert.equal(locations[6].name, 'win'); ``` -Your seventh `locations` value should have a `button text` array with three `REPLAY?` strings. +Il settimo valore di `locations` dovrebbe avere un array `button text` con tre stringhe `REPLAY?`. ```js assert.deepEqual(locations[6]["button text"], ['REPLAY?', 'REPLAY?', 'REPLAY?']); ``` -Your seventh `locations` value should have a `button functions` array with three `restart` variables. +Il settimo valore di `locations` dovrebbe avere un array `button functions` con tre variabili `restart`. ```js assert.deepEqual(locations[6]["button functions"], [restart, restart, restart]); diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62aa25fcb5837d43b4d9873d.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62aa25fcb5837d43b4d9873d.md index a69e68e77a9..31865680247 100644 --- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62aa25fcb5837d43b4d9873d.md +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62aa25fcb5837d43b4d9873d.md @@ -29,13 +29,13 @@ L'ottavo valore di `locations` dovrebbe avere una proprietà `name` con il valor assert.equal(locations[7].name, "easter egg"); ``` -Your eighth `locations` value should have a `button text` array with the strings `2`, `8`, and `Go to town square?`. +L'ottavo valore di `locations` dovrebbe avere un array `button text` con le stringhe `2`, `8` e `Go to town square?`. ```js assert.deepEqual(locations[7]["button text"], ["2", "8", "Go to town square?"]); ``` -Your eighth `locations` value should have a `button functions` an array with the variables `pickTwo`, `pickEight`, and `goTown`. +L'ottavo valore di `locations` dovrebbe avere un array `button functions` con le variabili `pickTwo`, `pickEight` e `goTown`. ```js assert.deepEqual(locations[7]["button functions"], [pickTwo, pickEight, goTown]); diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62ba17beef16c563069a65d8.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62ba17beef16c563069a65d8.md index e39624d127a..c799ac82eda 100644 --- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62ba17beef16c563069a65d8.md +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62ba17beef16c563069a65d8.md @@ -29,13 +29,13 @@ Il sesto valore di `locations` dovrebbe avere una proprietà `name` con il valor assert.equal(locations[5].name, 'lose'); ``` -Your sixth `locations` value should have a `button text` array with three `REPLAY?` strings. +Il sesto valore di `locations` dovrebbe avere un array `button text` con tre stringhe `REPLAY?`. ```js assert.deepEqual(locations[5]["button text"], ['REPLAY?', 'REPLAY?', 'REPLAY?']); ``` -Your sixth `locations` value should have a `button functions` array with three `restart` variables. +Il sesto valore di `locations` dovrebbe avere un array `button functions` con tre variabili `restart`. ```js assert.deepEqual(locations[5]["button functions"], [restart, restart, restart]); diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index e76abd90504..fd70f94af27 100644 --- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ console.log(arr); # --instructions-- -分割代入と残余変数を使用して、`Array.prototype.slice()` の効果を実現してください。`arr` が、元の配列 `source` から最初の 2 つの要素を省いた部分配列となるようにします。 +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. # --hints-- -`arr` は `[3,4,5,6,7,8,9,10]` である必要があります。 +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` は `[1,2,3,4,5,6,7,8,9,10]` である必要があります。 +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` は使用しないでください。 @@ -54,7 +58,7 @@ assert(source.every((v, i) => v === i + 1) && source.length === 10); assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index 4216b70eecb..8103828ab1f 100644 --- a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ As variáveis `a` e `b` pegam o primeiro e o segundo valores do array. Depois di # --instructions-- -Use atribuição de desestruturação com o parâmetro rest para executar `Array.prototype.slice()` de forma eficaz para que `arr` seja um sub array do array original `source` com os dois primeiros elementos omitidos. +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. # --hints-- -`arr` deve ser `[3,4,5,6,7,8,9,10]` +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` deve ser `[1,2,3,4,5,6,7,8,9,10]` +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` não deve ser usado. @@ -54,7 +58,7 @@ Desestruturação na `list` deve ser usada. assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` diff --git a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md b/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md index 5c1a66b8749..e8791765986 100644 --- a/curriculum/challenges/portuguese/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.md +++ b/curriculum/challenges/portuguese/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` +A regex `myRegex` deve retornar `false` para a string `FranklinRoosevelt` ```js myRegex.lastIndex = 0; assert(!myRegex.test('FranklinRoosevelt')); ``` -Your regex `myRegex` should return `false` for the string `EleanorRoosevelt` +A regex `myRegex` deve retornar `false` para a string `EleanorRoosevelt` ```js myRegex.lastIndex = 0; assert(!myRegex.test('EleanorRoosevelt')); ``` -You should use `.test()` to test the regex. +Você deve usar `.test()` para testar a regex. ```js assert(code.match(/myRegex.test\(\s*myString\s*\)/)); ``` -Your result should return `true`. +O resultado deve ser `true`. ```js assert(result === true); diff --git a/curriculum/challenges/ukrainian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/ukrainian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index e1913767c5a..783927289c1 100644 --- a/curriculum/challenges/ukrainian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/ukrainian/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -26,20 +26,24 @@ console.log(arr); # --instructions-- -Використовуйте деструктивне привласнення з рештою параметрів `Array.prototype.slice()`, так як `arr` є підмасивом оригінального масиву `source` з опущеними двома елементами. +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. # --hints-- -`arr` має бути `[3,4,5,6,7,8,9,10]` +`removeFirstTwo([1, 2, 3, 4, 5])` should be `[3, 4, 5]` ```js -assert(arr.every((v, i) => v === i + 3) && arr.length === 8); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArrWORemoved_.every((e, i) => e === i + 3) && testArrWORemoved_.length === 3); ``` -`source` має бути `[1,2,3,4,5,6,7,8,9,10]` +`removeFirstTwo()` should not modify `list` ```js -assert(source.every((v, i) => v === i + 1) && source.length === 10); +const testArr_ = [1, 2, 3, 4, 5]; +const testArrWORemoved_ = removeFirstTwo(testArr_); +assert(testArr_.every((e, i) => e === i + 1) && testArr_.length === 5); ``` `Array.slice()` не варто використовувати. @@ -54,7 +58,7 @@ assert(source.every((v, i) => v === i + 1) && source.length === 10); assert( __helpers .removeWhiteSpace(code) - .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.arr\]=list/i) + .match(/\[(([_$a-z]\w*)?,){1,}\.\.\.shorterList\]=list/i) ); ``` @@ -63,23 +67,25 @@ assert( ## --seed-contents-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { // Only change code below this line - const arr = list; // Change this line + const shorterList = list; // Change this line // Only change code above this line - return arr; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ``` # --solutions-- ```js -const source = [1,2,3,4,5,6,7,8,9,10]; function removeFirstTwo(list) { - const [, , ...arr] = list; - return arr; + const [, , ...shorterList] = list; + return shorterList; } -const arr = removeFirstTwo(source); + +const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const sourceWithoutFirstTwo = removeFirstTwo(source); ```