Created
December 6, 2018 03:40
-
-
Save harrisonmalone/65dc4e3d39e8be0682bd972121bc8626 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const array = [ 1, 2, 3, 1, 2, 3 ] | |
const uniq = array.filter(function(element, i) { | |
return array.indexOf(element) === i | |
}) | |
console.log(uniq) | |
// => [ 1, 2, 3 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment