Skip to content

Instantly share code, notes, and snippets.

@faustoct1
Created July 5, 2022 19:55
Show Gist options
  • Save faustoct1/fafc808a89021aa4625276e6e2904eef to your computer and use it in GitHub Desktop.
Save faustoct1/fafc808a89021aa4625276e6e2904eef to your computer and use it in GitHub Desktop.
Eliminar itens duplicados no array com 1 linha em javascript
const set = new Set([1,1,2,2,3,3,4,4,5,5])
const array = Array.from(set)
console.log(array) //(5) [1, 2, 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment