JSON data currently looks like this string:
["ID","Name","Age"],["212","David","38"]
And I would like for it to look like this:
{"ID":"212","Name":"David","Age":"38"}
Thanks for your help in advance
I found this code and it solves most of the issue
var columns = ["ID", "Name", "Age"];
var rows = ["212", "David", "38"];
var result = rows.reduce(function(result, field, index) {
result[columns[index]] = field;
return result;
}, {})
console.log(result);