Skip to content

Instantly share code, notes, and snippets.

@tobiastom
Forked from ttepasse/Mein Code
Created May 3, 2010 01:39
Show Gist options
  • Save tobiastom/387637 to your computer and use it in GitHub Desktop.
Save tobiastom/387637 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 ( var key in keys )
if ( !keys.hasOwnProperty( key ) )
continue
result.push( key )
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment