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

131
Views
Esperando una cadena pero obteniendo una matriz

Quiero obtener una matriz que tenga objetos que contengan cadenas, pero solo obtengo la matriz sin objetos ni cadenas

 const emails = [ { email: "dot@gmail.com", }, { email: "ke@gmail.com", }, ]; const msg = { personalizations: emails.map((email) => ({ to: [{ email: email.email }], subject: "Hello World from the Personalization API!", })), };

cuando consuelo log msg obtengo:

 { personalizations: [ { to: [Array], subject: 'Hello World from the Personalization API!' }, { to: [Array], subject: 'Hello World from the Personalization API!' } ], }

Quiero obtener los valores de cuando inicie sesión en la consola de esta manera:

 "personalizations": [ { "to": [ { "email": "john@example.com" } ], "send_at": 1600188812 }, { "to": [ { "email": "jane@example.com" } ], "send_at": 1600275471 } ]
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

A partir de la salida. Es muy fácil de hacer. Creo que todo lo que necesitas es JSON.stringify()
Entonces: console.log(JSON.stringify(msg)); , Debería hacer el trabajo.
Sin embargo, para hacerlo legible, necesita JSON Prettier

about 4 years ago · Santiago Trujillo Report
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!