This commit is contained in:
Lemuel Marquez
2021-01-18 15:14:02 -06:00
parent df982d5040
commit bc4e1bfc85
+3 -6
View File
@@ -326,14 +326,11 @@ const carpetasRepetidas = async () => {
let repetidas = [];
for (let i = 0; i < carpetas.length; i++) {
let aux = [carpetas[i]];
for (let j = i + 1; j < carpetas.length; j++) {
if (carpetas[i].name === carpetas[j].name) repetidas.push(carpetas[j]);
else {
repetidas.push(carpetas[i]);
i = j - 1;
break;
}
if (carpetas[i].name === carpetas[j].name) carpetas.push(carpetas[j]);
}
if (aux.length > 1) repetidas.push(aux);
}
console.log(carpetas.length);
console.log(carpetas);