I have a function (in JavaScript) that compares 2 arrays:
let diferencas = [];
let numD = 0;
for (let a = 0; a < dados.length; a++) {
if (dados[a].idEmail === results[a].idEmail) {
console.log('Repetido!')
} else {
numD++;
diferencas.push(dados[a]);
}
}
console.log('Diferenças encontradas: ' + numD)
console.log(diferencas)
The 2 arrays are composed in their first 8 positions by identical objects, and the results
array has only 8 positions since it comes from a MongoDB query and the dados
array has 9 positions, since it comes from a query to the email provider and comes with more recent emails.
My problem is: How do I get those surplus positions in the array dados
??