Created
September 1, 2017 13:16
-
-
Save MedinaGitHub/e5f15e7e7608d554451e99bd8b917fd1 to your computer and use it in GitHub Desktop.
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
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