showing results for - "callback without duplicates javascript"
Emmy
11 Nov 2017
1function myFunction(myArray, callBack){
2
3 var unique = myArray.filter(function(item, pos) {
4   //validates whether the first occurrence of current item in array
5   // equals the current position of the item (only return those items) 
6   return myArray.indexOf(item) == pos;
7 });
8
9 //wrap your result and pass to callBack function 
10 callBack(unique);
11
12}