I have tried to understand this function :
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
var a = ['a', 1, 'a', 2, '1'];
var unique = a.filter(onlyUnique); // returns ['a',1,2,'1']
I wonder how onlyUnique knows about value, index and self being indeed the value, the index, and the array ? Is this related to the filter ?