Skip to content

Instantly share code, notes, and snippets.

@tommy351
Last active December 13, 2015 19:48
Show Gist options
  • Save tommy351/4965214 to your computer and use it in GitHub Desktop.
Save tommy351/4965214 to your computer and use it in GitHub Desktop.
var unique = function(arr){
var a = [],
l = arr.length;
for (var i = 0; i < l; i++){
for (var j = i + 1; j < l; j++){
if (arr[i] === arr[j]) j = ++i;
}
a.push(arr[i]);
}
return a;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment