Is there a way to combine multiple Json objects into one single object?
When parsing an array from AJAX, I noticed that it logs like this:
0:{id: "24", user: "Joe", pass: "pass", name: "Joe Bloggs", role: "Technical Support", ...}
1:{id: "25", user: "Jim", pass: "pass", name: "Jim Bloggs", role: "Technical Support", ...}
2:{id: "26", user: "John", pass: "pass", name: "John Bloggs", role: "Technical Support", ...}
I am seeking a solution where I can iterate through the data and consolidate the id's and users into a single line in this specific format:
0: {Joe : 24, Jim : 25, John : 26}
Any suggestions on how to achieve this?
Thank you!