Skip to content

Instantly share code, notes, and snippets.

@eduardo-matos
Created May 7, 2013 14:01
Show Gist options
  • Save eduardo-matos/5532792 to your computer and use it in GitHub Desktop.
Save eduardo-matos/5532792 to your computer and use it in GitHub Desktop.
Array - remove duplicate items.
function removeDuplicate(oldArray) {
var newArray = [];
var i = 0;
var len = oldArray.length;
for(; i < len; i++) {
if(newArr.indexOf(arr[i])<0) {
newArr.push(arr[i])
}
}
return newArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment