Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 18, 2019 16: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 parzibyte/241d5668933ebddb30f93fdb01ebb42e to your computer and use it in GitHub Desktop.
Save parzibyte/241d5668933ebddb30f93fdb01ebb42e to your computer and use it in GitHub Desktop.
Eliminar duplicados de arreglo con JavaScript usando conjuntos https://parzibyte.me/blog/2018/12/04/eliminarduplicados-arreglos-javascript/
/*
Convertirlo a conjunto y después a arreglo
Visita: parzibyte.me
*/
let arregloConRepetidos = [1, 2, 3, 4, 1, 2, 2, 2, 10];
console.log("Con repetidos es:", arregloConRepetidos);
let sinRepetidos = [...new Set(arregloConRepetidos)];
console.log("Sin repetidos es:", sinRepetidos);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment