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

116
Views
Removing Object from Array of Array in Javascript

Hey Guys I am exporting some data.
And the challenge I am facing is the data should be in Array of Objects but don't know the data format is Array in Array of Objects.
I can write a script to transform the data to the desired format.
Can anyone help me out with how can I remove the object from the inner array to the outer array?
The data is in this format.

{
  "data": [
    [
      {
        "id": "4101"
      }
    ]
  ]
}

My Resultant Format looks like this Can anyone help me write a javascript to accomplish this objective

{
  "data": [
      {
        "id": "4104",
      }
  ]
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Please give a try to this :

var a=obj.data.splice(0, 1);
obj.data.push(a[0]);

or in one line if you want :

obj.data.push(obj.data.splice(0, 1)[0]);

Provided you cannot correct the input at the source.

about 4 years ago · Juan Pablo Isaza 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!