Skip to content

Instantly share code, notes, and snippets.

@MedinaGitHub
Created September 1, 2017 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MedinaGitHub/e5f15e7e7608d554451e99bd8b917fd1 to your computer and use it in GitHub Desktop.
Save MedinaGitHub/e5f15e7e7608d554451e99bd8b917fd1 to your computer and use it in GitHub Desktop.
let items = new Set([1, 2, 3, 4, 5, 5, 5, 5, 5, 5]);
console.log(items); //Resultado 1,2,3,4,5
items.delete(3);//Resultado 1,2,4,5
//items.clear(); borra todo
let numerosArray = [1,2,3,4,4,4,4,4,];
//con una funcion anonima limpie el arreglo de los repetidos
var clean = (num => [... new Set(num)])(numerosArray);
console.log(clean);//Resultado 1,2,3,4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment