Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
Finding duplicate values from the list of array elements in javascript

So I was trying to solve this issue and someone suggested me to use Set(). So this was question and solution given to me:

var myArr = [1,2,2,3,3,4,5,5];
var myArr1 = [...new Set(myArr)];

console.log(myArr1);

So basically this solves my problem but my question is why did we use 3 dots before using new keyword. Also if I am not using that I am getting [object Set] in my console. So can someone explain to me the concept behind this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda