This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Description
The current answer for the duplicates question is this:
var seen = {};
var dupes = [];
for (var i = 0, len = arr.length; i < len; i++) {
seen[arr[i]] = seen[arr[i]] ? seen[arr[i]] + 1 : 1;
}
for (var item in seen) {
if (seen.hasOwnProperty(item) && seen[item] > 1) {
dupes.push(item);
}
}
return dupes;
The test rejects it saying:
AssertionError: expected [ '1', '3', '4' ] to deeply equal [ 1, 3, 4 ]
at Context.<anonymous> (tests/app/arrays.js:96:30)
I changed the following line in my code to make it pass:
dupes.push(item)
//changes to
dupes.push(parseInt(item, 10));
It seems like either the test should expect strings or the answer should be updated.