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

92
Views
Cómo agregar una propiedad de una matriz de objetos JSON a un conjunto en Javascript

Estoy buscando la forma más eficiente de recorrer varias matrices de objetos y agregar valores a un conjunto.

 // This is how filesData object looks const filesData : { hashedEmail: "liugdfkjn83i", name: "JohnSimith" }
 const setOfHashedEmails = new Set<string>(); for (const filesData of objectDataInS3Folder) { // filesData is an array of objects // Loop over the array of objects and add only the hashedItem to a set filesData.forEach(element=> setOfHashedEmails.add(element.hashedEmail)); }

¿Hay una mejor manera de recorrer la matriz de objetos varias veces y agregar el correo electrónico hash al conjunto (mediante el uso del operador de propagación)?

Otra forma posible puede ser:

 const arrayOfAllUsers = []; for (const filesData of objectDataInS3Folder) { arrayOfAllUsers.concat(filesData); } // Create a set of hashed emails const setOfHashedEmails = new Set<string>(arrayOfAllUsers.map(item => item.HashedEmail));
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!