I have two arrays like the following
var array1=[10,20,30,40,50];
var array2=["A","B","C","D","F"];
I want to convert them to json Like this
var data = [
{ x: "A", y: 10 },
{ x: "B", y: 20 },
{ x: "C", y: 30 },
{ x: "D", y: 40 },
{ x: "F", y: 50 }
];
I need this data to use it in D3 charts.