Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function uniqueArr(arr, juggfunc) {
var resArr = [];
var has = false;
for (var i = 0; i < arr.length; ++i) {
for (var j = 0; j < resArr.length; ++j) {
if( juggfunc(resArr[j], arr[i]) ){
has = true;
}
}
if (has) {
has = false;
continue;
}
resArr.push(arr[i]);
has = false;
}
return resArr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.