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

269
Views
Unable to Push multiple values array into keys array into a single Array using javascript

I have a Keys Array and Multiple Values Array . I want push values array into keys Array . Example :-

data[0] :['ktCalender', 'presenter', 'emailId', 'topic', 'status']             // Keys

[1] : ['2022-05-05', 'abc', 'abc@gmail.com', 'cricket overview', 'sheduled'] // Values [3]: ['2022-05-04', 'xyz', 'xyz@gmail.com', 'ApS', 'organized']. // Values

I want Answer like : [ {ktCalender:2022-05-05,presenter:'abc',emailId:'abc@gmail.com',topic:'cricket overview',status:'sheduled'}, ktCalender:'2022-05-04',presenter:'xyx',emailId:'xyz@gmail.com',topic:'APS',status:'organized'},

]

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

let data = ['ktCalender', 'presenter', 'emailId', 'topic', 'status'];
let Values = [];
Values[0] = ['2022-05-04', 'xyz', 'xyz@gmail.com', 'ApS', 'organized'];
Values[1] = ['2022-05-05', 'abc', 'abc@gmail.com', 'cricket overview', 'sheduled']


let result = [];
Values.forEach((val) => {
    const obj = data.reduce((accumulator, element, index) => {
        return {...accumulator, [element]: val[index]};
    }, {});
    result.push(obj);
});
console.log(result);

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!