6
I need to remove the repeated values of a vector and play these repeated values in another vector, I found this code that removes the repeated values, but I do not know how to capture them, and I am not understanding very well how the filter
is acting to remove the repeated values. Can anyone explain to me in more detail what is happening in the code?
var aux = vetor.filter(function(elemento, i) {
return vetor.indexOf(elemento) == i;
})