if (!Array.prototype.uniq) | |
{ | |
Array.prototype.uniq = function(fun) | |
{ | |
var seen = {}; | |
return this.filter(function (el) { | |
var key = typeof (fun) == "function" ? fun(el) : el; | |
var r = !seen[key]; | |
seen[key] = true; | |
return r; | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment