Skip to content

Instantly share code, notes, and snippets.

@ttepasse
Forked from tobiastom/Mein Code
Created May 3, 2010 01:24
Show Gist options
  • Save ttepasse/387627 to your computer and use it in GitHub Desktop.
Save ttepasse/387627 to your computer and use it in GitHub Desktop.
Array.prototype.unique = function () {
var keys = {},
result = [],
items = this.length
while (items)
keys[this[--items]] = true
for (item in keys)
if (keys.hasOwnProperty(item)) result.push(item)
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment