Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!