Created
May 17, 2018 15:02
-
-
Save giventofly/c0f8a8c9ff204b8d8a12ba6d44968536 to your computer and use it in GitHub Desktop.
remover duplicados vanilla js
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
//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