diff --git a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md b/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
index 02a1e58da0..e7086c87aa 100644
--- a/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
+++ b/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
@@ -45,6 +45,18 @@ assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [
]);
```
+`uniteUnique([1, 3, 2], [5, 4], [5, 6])` dovrebnbe restituire `[1, 3, 2, 5, 4, 6]`.
+
+```js
+assert.deepEqual(uniteUnique([1, 3, 2], [5, 4], [5, 6]), [1, 3, 2, 5, 4, 6]);
+```
+
+`uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1])` dovrebbe restituire `[1, 3, 2, 5, 4]`.
+
+```js
+assert.deepEqual(uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4]);
+```
+
# --seed--
## --seed-contents--
@@ -62,7 +74,11 @@ uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
```js
function uniteUnique(arr) {
return [].slice.call(arguments).reduce(function(a, b) {
- return [].concat(a, b.filter(function(e) {return a.indexOf(e) === -1;}));
+ return [].concat(
+ a,
+ b.filter(function(e, currentIndex) {
+ return b.indexOf(e) === currentIndex && a.indexOf(e) === -1;
+ }));
}, []);
}
```
diff --git a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/define-a-primitive-data-type.md b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/define-a-primitive-data-type.md
index 2bc3f2dd1b..ffdb30b3c9 100644
--- a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/define-a-primitive-data-type.md
+++ b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/define-a-primitive-data-type.md
@@ -1,6 +1,6 @@
---
id: 597089c87eec450c68aa1643
-title: Define a primitive data type
+title: Definire un tipo di dato primitivo
challengeType: 5
forumTopicId: 302248
dashedName: define-a-primitive-data-type
@@ -8,96 +8,96 @@ dashedName: define-a-primitive-data-type
# --description--
-Define a type that behaves like an integer but has a lowest valid value of 1 and a highest valid value of 10.
+Defnisci un tipo di dato che si comporta come un numero intero ma ha il valore valido minimo di 1 e il valore valido massimo di 10.
-Error handling:
+Gestione degli errori:
- - If you try to instantiate a
Num
with a value outside of 1 - 10, it should throw a TypeError
with an error message of 'Out of range'
.
- - If you try to instantiate a
Num
with a value that is not a number, it should throw a TypeError
with an error message of 'Not a Number'
.
+ - Se si prova a instanziare un
Num
con un valore al di fuori del range 1 - 10, dovrebbe dare un errore TypeError
con un messaggio di errore di 'Out of range'
.
+ - Se si prova a istanziare
Num
con un valore che non è un numero, dovrebbe dare un TypeError
con un messaggio di errore di 'Not a Number'
.
# --hints--
-`Num` should be a function.
+`Num` dovrebbe essere una funzione.
```js
assert(typeof Num === 'function');
```
-`new Num(4)` should return an object.
+`new Num(4)` dovrebbe restituire un oggetto.
```js
assert(typeof new Num(4) === 'object');
```
-`new Num('test')` should throw a TypeError with message 'Not a Number'.
+`new Num('test')` dovrebbe dare un errore TypeError con messaggio 'Not a Number'.
```js
assert.throws(() => new Num('test'), TypeError);
```
-`new Num(0)` should throw a TypeError with message 'Out of range'.
+`new Num(0)` dovrebbe dare un TypeError con messaggio 'Out of range'.
```js
assert.throws(() => new Num(0), TypeError);
```
-`new Num(-5)` should throw a TypeError with message 'Out of range'.
+`new Num(-5)` dovrebbe dare un TypeError con messaggio 'Out of range'.
```js
assert.throws(() => new Num(-5), TypeError);
```
-`new Num(10)` should throw a TypeError with message 'Out of range'.
+`new Num(10)` dovrebbe dare un TypeError con messaggio 'Out of range'.
```js
assert.throws(() => new Num(11), TypeError);
```
-`new Num(20)` should throw a TypeError with message 'Out of range'.
+`new Num(20)` dovrebbe dare un TypeError con messaggio 'Out of range'.
```js
assert.throws(() => new Num(20), TypeError);
```
-`new Num(3) + new Num(4)` should equal 7.
+`new Num(3) + new Num(4)` dovrebbe essere uguale a 7.
```js
assert.equal(new Num(3) + new Num(4), 7);
```
-`new Num(3) - new Num(4)` should equal -1.
+`new Num(3) - new Num(4)` dovrebbe essere uguale a -1.
```js
assert.equal(new Num(3) - new Num(4), -1);
```
-`new Num(3) * new Num(4)` should equal 12.
+`new Num(3) * new Num(4)` dovrebbe essere uguale a 12.
```js
assert.equal(new Num(3) * new Num(4), 12);
```
-`new Num(3) / new Num(4)` should equal 0.75.
+`new Num(3) / new Num(4)` dovrebbe essere uguale a 0.75.
```js
assert.equal(new Num(3) / new Num(4), 0.75);
```
-`new Num(3) < new Num(4)` should be true.
+`new Num(3) < new Num(4)` dovrebbe restituire true.
```js
assert(new Num(3) < new Num(4));
```
-`new Num(3) > new Num(4)` should be false.
+`new Num(3) > new Num(4)` dovrebbe restituire false.
```js
assert(!(new Num(3) > new Num(4)));
```
-`(new Num(5)).toString()` should return '5'
+`(new Num(5)).toString()` dovrebbe restituire '5'
```js
assert.equal(new Num(5).toString(), '5');
diff --git a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/department-numbers.md b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/department-numbers.md
index 0eba1bec54..1b81883ee5 100644
--- a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/department-numbers.md
+++ b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/department-numbers.md
@@ -1,6 +1,6 @@
---
id: 59f40b17e79dbf1ab720ed7a
-title: Department Numbers
+title: I numeri dei dipartimenti
challengeType: 5
forumTopicId: 302249
dashedName: department-numbers
@@ -8,23 +8,23 @@ dashedName: department-numbers
# --description--
-There is a highly organized city that has decided to assign a number to each of their departments:
+C'è una città altamente organizzata che ha deciso di assegnare un numero a ciascuno dei suoi dipartimenti:
- - Police department
- - Sanitation department
- - Fire department
+ - Dipartimento di polizia
+ - Dipartimento igienico-sanitario
+ - Vigili del Fuoco
-Each department can have a number between 1 and 7 (inclusive).
+Ogni dipartimento può avere un numero compreso tra 1 e 7 (inclusi).
-The three department numbers are to be unique (different from each other) and must add up to the number 12.
+I tre numeri dei dipartimenti devono essere unici (diversi gli uni dagli altri) e sommati devono fare numero 12.
-The Chief of the Police doesn't like odd numbers and wants to have an even number for his department.
+Al Capo della Polizia non piacciono numeri dispari e vuole avere un numero pari per il suo dipartimento.
# --instructions--
-Write a program which outputs all valid combinations as an array.
+Scrivi un programma che restituisca tutte le combinazioni valide come array.
```js
[2, 3, 7] [2, 4, 6] [2, 6, 4]
@@ -36,25 +36,25 @@ Write a program which outputs all valid combinations as an array.
# --hints--
-`combinations` should be a function.
+`combinations` dovrebbe essere una funzione.
```js
assert(typeof combinations === 'function');
```
-`combinations([1, 2, 3], 6)` should return an Array.
+`combinations([1, 2, 3], 6)` dovrebbe restituire un array.
```js
assert(Array.isArray(combinations([1, 2, 3], 6)));
```
-`combinations([1, 2, 3, 4, 5, 6, 7], 12)` should return an array of length 14.
+`combinations([1, 2, 3, 4, 5, 6, 7], 12)` dovrebbe restituire un array di lunghezza 14.
```js
assert(combinations(nums, total).length === len);
```
-`combinations([1, 2, 3, 4, 5, 6, 7], 12)` should return all valid combinations.
+`combinations([1, 2, 3, 4, 5, 6, 7], 12)` dovrebbe restituire tutte le combinazioni valide.
```js
assert.deepEqual(combinations(nums, total), result);
diff --git a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/discordian-date.md b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/discordian-date.md
index 811a3b867e..1b08d57fa3 100644
--- a/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/discordian-date.md
+++ b/curriculum/challenges/italian/10-coding-interview-prep/rosetta-code/discordian-date.md
@@ -1,6 +1,6 @@
---
id: 59f4eafba0343628bb682785
-title: Discordian date
+title: Data discordiana
challengeType: 5
forumTopicId: 302250
dashedName: discordian-date
@@ -8,17 +8,17 @@ dashedName: discordian-date
# --description--
-Convert a given date from the [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian calendar "wp: Gregorian calendar") to the [Discordian calendar](https://en.wikipedia.org/wiki/Discordian calendar "wp: Discordian calendar").
+Converti una data dal [calendario gregoriano](https://en.wikipedia.org/wiki/Gregorian calendar "wp: Gregorian calendar") al [calendario discordiano](https://en.wikipedia.org/wiki/Discordian calendar "wp: Discordian calendar").
# --hints--
-`discordianDate` should be a function.
+`discordianDate` dovrebbe essere una funzione.
```js
assert(typeof discordianDate === 'function');
```
-`discordianDate(new Date(2010, 6, 22))` should return `"Pungenday, the 57th day of Confusion in the YOLD 3176"`.
+`discordianDate(new Date(2010, 6, 22))` dovrebbe restituire `"Pungenday, the 57th day of Confusion in the YOLD 3176"`.
```js
assert(
@@ -27,7 +27,7 @@ assert(
);
```
-`discordianDate(new Date(2012, 1, 28))` should return `"Prickle-Prickle, the 59th day of Chaos in the YOLD 3178"`.
+`discordianDate(new Date(2012, 1, 28))` dovrebbe restituire `"Prickle-Prickle, the 59th day of Chaos in the YOLD 3178"`.
```js
assert(
@@ -36,7 +36,7 @@ assert(
);
```
-`discordianDate(new Date(2012, 1, 29))` should return `"Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!"`.
+`discordianDate(new Date(2012, 1, 29))` dovrebbe restituire `"Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!"`.
```js
assert(
@@ -45,7 +45,7 @@ assert(
);
```
-`discordianDate(new Date(2012, 2, 1))` should return `"Setting Orange, the 60th day of Chaos in the YOLD 3178"`.
+`discordianDate(new Date(2012, 2, 1))` dovrebbe restituire `"Setting Orange, the 60th day of Chaos in the YOLD 3178"`.
```js
assert(
@@ -54,7 +54,7 @@ assert(
);
```
-`discordianDate(new Date(2010, 0, 5))` should return `"Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!"`.
+`discordianDate(new Date(2010, 0, 5))` dovrebbe restituire `"Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!"`.
```js
assert(
@@ -63,7 +63,7 @@ assert(
);
```
-`discordianDate(new Date(2011, 4, 3))` should return `"Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!"`.
+`discordianDate(new Date(2011, 4, 3))` dovrebbe restituire `"Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!"`.
```js
assert(
@@ -72,7 +72,7 @@ assert(
);
```
-`discordianDate(new Date(2015, 9, 19))` should return `"Boomtime, the 73rd day of Bureaucracy in the YOLD 3181"`.
+`discordianDate(new Date(2015, 9, 19))` dovrebbe restituire `"Boomtime, the 73rd day of Bureaucracy in the YOLD 3181"`.
```js
assert(
diff --git a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
index 111e0a1afb..30716ab782 100644
--- a/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
+++ b/curriculum/challenges/japanese/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union.md
@@ -45,13 +45,13 @@ assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [
]);
```
-`uniteUnique([1, 3, 2], [5, 4], [5, 6])` should return `[1, 3, 2, 5, 4, 6]`.
+`uniteUnique([1, 3, 2], [5, 4], [5, 6])` は `[1, 3, 2, 5, 4, 6]` を返す必要があります。
```js
assert.deepEqual(uniteUnique([1, 3, 2], [5, 4], [5, 6]), [1, 3, 2, 5, 4, 6]);
```
-`uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1])` should return `[1, 3, 2, 5, 4]`.
+`uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1])` は `[1, 3, 2, 5, 4]` を返す必要があります。
```js
assert.deepEqual(uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4]);