var graphdata = [["A", "B", "C", "D"], [0.5, 0.25, 0.5, 0.25]];
function randomData (){
var labels = graphdata[0]
var labels2 = graphdata[1];
console.log();
return labels.map(function(labels, labels2){
console.log(labels2);
return { label: labels , value: labels2 }
});
}
labels iterates correctly for A, B, C, D. but labels2 gets squashed to 0, 1, 2, 3, and I am not sure why. Right before the return labels.map() call, if I console.log(), I can get the properly fractions to output but after that those values disappear and I am not sure why.