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

171
Views
How to Split Multiple array to each array and from each array to value in javascript

I am getting this from single PHP file with xmlhttprequest, Here is the result I am getting.

{request: {…}, service: Array(2)}
 service: (2) [{…}, {…}]
 request: {…}
 [[Prototype]]: Object

In the service property, I am getting 2 elements in an array and in request 1 array.

I want to separate both array then split value of the both array, so can any one help me with this how to do it in JavaScript.

Here is the code I am using to get data from PHP :

 var request = new XMLHttpRequest();
            request.open("POST", API_PATH + 'data.php');
            request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            request.onreadystatechange = function () {
               if (request.readyState === 4) {
       
        
            request.onload = function(){

            let datareq = JSON.parse(request.responseText);
            

            console.log(datareq);


            }

               }
            };

            const data = {str , ltr};


               request.send(JSON.stringify(data));
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!