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

167
Views
Array of arrays to array of Objects
const events = [
        [{
          createdAt: "2021-12-06T16:32:59.260Z"
    location: "Off-Site"
    name: "Viewing"
        }],
        [{
          createdAt: "2021-12-06T16:32:59.260Z"

... }],

    ..........
]

Hi I have question. From the above can i be able to convert the data to somethin like

const events = [
        {
          createdAt: "2021-12-06T16:32:59.260Z"
    location: "Off-Site"
        },
        {
          createdAt: "2021-12-06T16:32:59.260Z"

... },

    ..........
]

if anyone knows please answer

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use Array.flat method

The flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified dept

const arr = [[1,2,3],[4,5]];

const res = arr.flat()

console.log(res)

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!