-
-
Save tobiastom/387637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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