this is an array of objects,
var data = [{"label" : "1", "value" : 12},
{"label" : "1", "value" : 12 },
{"label" : "1", "value" : 12},
{"label" : "1", "value" : 12}];
how can i add values to these dynamically? i tried the below code but no success
var lab=["1","2","3", "4"];
var val= [42,55,51,22];
var data =new Array();
for(var i=0; i<4; i++) {
data[i].label= lab[i];
data[i].value=val[i]; }
anyone please.. thanks in advance