I have 3 different arrays, one with column names of a table and the other with data. How can I combine them to form one single json object in AngularJS?
var keyArray = ["Col1","Col2","Col3",...];
var ValArray1 = ["v1.1","v1.2","v1.3",...];
var ValArray2 = ["v2.1","v2.2","v2.3",...];
I want a json something like this
entries[
{
name: "Col1",
value: "v1.1"
},
{name: "Col2",
value: "v1.2"
},
...,
{name: "Col3",
value: "v2.3"
}
]