Skip to content

Instantly share code, notes, and snippets.

@giventofly
Created May 17, 2018 15:02
Show Gist options
  • Save giventofly/c0f8a8c9ff204b8d8a12ba6d44968536 to your computer and use it in GitHub Desktop.
Save giventofly/c0f8a8c9ff204b8d8a12ba6d44968536 to your computer and use it in GitHub Desktop.
remover duplicados vanilla js
//https://codehandbook.org/how-to-remove-duplicates-from-javascript-array/
//remover duplicados
function removeDuplicates(arr) {
let unique_array = []
for (let i = 0; i < arr.length; i++) {
if (unique_array.indexOf(arr[i]) == -1) {
unique_array.push(arr[i])
}
}
return unique_array
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment